.business-story {
  overflow: clip;
  background: radial-gradient(ellipse at 78% 12%, var(--room-glow), transparent 57%), var(--room-front);
  border-bottom: 1px solid var(--room-line);
}

.business-flow {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.25fr);
  align-items: start;
  column-gap: clamp(1.5rem, 5.1vw, 5.3rem);
  padding-block: clamp(2.5rem, 5vw, 4.7rem);
}

.business-visual {
  grid-area: 1 / 2;
  position: sticky;
  top: calc(var(--room-header) + clamp(1rem, calc(var(--tri-room-viewport-height, 100vh) * 0.03), 2.1rem));
  justify-self: center;
  width: min(100%, max(19rem, calc((calc(var(--tri-room-viewport-height, 100vh) * 1) - var(--room-header) - 11rem) * 1.5)));
  min-width: 0;
  margin: 0;
  isolation: isolate;
  border: 1px solid var(--room-glass-edge);
  border-radius: clamp(.85rem, 1.65vw, 1.5rem);
  background: var(--room-surface);
  box-shadow: 0 18px 45px color-mix(in srgb, var(--room-ink) 11%, transparent);
}

.story-room {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 3 / 2;
  border-radius: inherit;
  border-end-start-radius: 0;
  border-end-end-radius: 0;
  background: radial-gradient(ellipse at 61% 54%, var(--room-glow), var(--room-front) 76%);
}

.story-room-image {
  position: absolute;
  top: 3%;
  right: -6%;
  width: 95%;
  height: 93%;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px #0002);
}

.story-agent { position: absolute; z-index: 1; left: -5%; bottom: -3%; width: 54%; height: auto; filter: drop-shadow(0 10px 18px #0003); }
.story-agent-name { position: absolute; z-index: 2; left: 9%; bottom: 5%; color: var(--room-ink); background: var(--room-glass); border: 1px solid var(--room-glass-edge); border-radius: 99px; padding: .3rem .66rem; font-size: clamp(.74rem, 1.46vw, 1rem); font-weight: 740; box-shadow: inset 0 1px var(--room-glass-rim), 0 6px 15px #0002; backdrop-filter: blur(13px) saturate(1.15); }
.business-app-mount { position: absolute; z-index: 3; right: 4%; bottom: 20%; width: 57%; min-width: 0; }
.business-app-mount .rail-icons > :not(.selected) { display: none; }
.business-app-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .4rem .56rem; padding: .62rem .78rem; background: color-mix(in srgb, var(--room-soft) 52%, var(--room-surface)); border-bottom: 1px solid var(--room-line); }
.business-app-head strong, .business-app-head small { display: block; line-height: 1.18; }
.business-app-head strong { font-size: clamp(.83rem, 1.45vw, 1.26rem); font-weight: 750; }
.business-app-head small { color: var(--room-muted); margin-top: .18rem; font-size: clamp(.65rem, 1.04vw, .82rem); }
.business-app-head img { width: clamp(16px, 2vw, 28px); height: auto; }
.business-app-details { margin: 0; padding: .15rem .78rem .45rem; }
.business-app-details > div { display: flex; align-items: center; justify-content: space-between; gap: .28rem .48rem; min-height: 2.34rem; padding-block: .31rem; }
.business-app-details > div + div { border-top: 1px solid var(--room-line); }
.business-app-details dt { font-size: clamp(.65rem, 1.02vw, .85rem); color: var(--room-muted); }
.business-app-details dd { margin: 0; text-align: end; font-size: clamp(.65rem, 1.02vw, .86rem); font-weight: 730; }
.business-app-state { padding: .17rem .38rem; border: 1px solid var(--room-line); border-radius: .38rem; background: var(--room-soft); line-height: 1.13; }
[data-story-step="1"] .business-app-state { background: color-mix(in srgb, #b76a36 14%, var(--room-surface)); color: var(--room-ink); }
[data-story-step="2"] .business-app-state { background: color-mix(in srgb, var(--room-hand-ink) 10%, var(--room-surface)); color: var(--room-hand-ink); }
[data-story-step="3"] .business-app-state { background: color-mix(in srgb, var(--room-brand) 15%, var(--room-surface)); color: var(--room-link); }

.business-visual figcaption {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: .53rem;
  min-height: 3.2rem;
  padding: .69rem .9rem;
  border-top: 1px solid var(--room-line);
  color: var(--room-muted);
  font-size: clamp(.76rem, 1.08vw, .93rem);
  line-height: 1.45;
  font-weight: 680;
}

.business-visual figcaption::before { content: ""; width: .43rem; height: .43rem; border-radius: 50%; background: var(--room-brand); }
.business-visual[data-story-step="1"] figcaption::before { background: #b76a36; }
.business-steps { grid-area: 1 / 1; min-width: 0; margin: 0; padding: 0; list-style: none; }
.business-step { display: grid; align-content: center; justify-items: start; gap: .8rem; min-height: clamp(19rem, calc(var(--tri-room-viewport-height, 100vh) * 0.57), 32rem); padding-block: 1.9rem; border-bottom: 1px solid var(--room-line); }
.business-step:last-child { border-bottom: 0; }
.business-step .display { max-width: 19ch; font-size: clamp(2.15rem, 3.9vw, 4rem); text-wrap: pretty; }
.business-description { max-width: 45ch; color: var(--room-muted); }
.business-step .text-link { margin-top: .2rem; }
.technical-intro { padding-block: clamp(3.3rem, 6vw, 6rem) .4rem; text-align: center; }
.technical-intro .eyebrow { justify-content: center; }
.technical-intro .display { margin-block: .65rem .8rem; font-size: clamp(2.25rem, 4.7vw, 4.4rem); }
.technical-intro .display em { display: inline; }
.technical-intro > p:last-child { max-width: 55ch; margin-inline: auto; color: var(--room-muted); }

.motion-mount {
  min-height: 5.7rem;
  background: linear-gradient(155deg, color-mix(in srgb, var(--room-surface) 71%, var(--room-glass)), var(--room-surface));
}

.motion-track {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .48fr) minmax(0, 1fr) minmax(0, .48fr) minmax(0, 1fr) minmax(0, .48fr) minmax(0, .86fr);
  align-items: start;
  padding: .53rem clamp(.42rem, 1.3vw, 1rem) .55rem;
  color: var(--room-muted);
}

.motion-node { display: grid; justify-items: center; align-items: start; gap: .12rem; min-width: 0; text-align: center; }
.motion-node > span { font-size: clamp(.65rem, 1.02vw, .87rem); line-height: 1.25; font-weight: 690; overflow-wrap: anywhere; }
.motion-object { position: relative; display: grid; align-items: start; justify-items: center; width: 100%; height: 3.45rem; min-width: 0; padding-top: .15rem; }
.motion-wire { position: relative; height: 1px; margin-top: 1.5rem; background: var(--room-line); }
.motion-wire i { position: absolute; left: 0; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--room-brand); opacity: 0; box-shadow: 0 0 7px var(--room-brand); }
.motion-wire.third { opacity: .42; }
.pickup-node { opacity: .56; transition: opacity 360ms ease; }
.business-visual[data-story-step="1"] .motion-wire.second { background: repeating-linear-gradient(90deg, #b76a36 0 4px, transparent 4px 7px); }
.business-visual:is([data-story-step="2"], [data-story-step="3"]) :is(.motion-wire.first, .motion-wire.second) { background: color-mix(in srgb, var(--room-brand) 57%, var(--room-line)); }
.business-visual[data-story-step="3"] :is(.motion-wire.third, .pickup-node) { opacity: 1; }
.business-visual:is([data-story-step="1"], [data-story-step="2"]) .motion-wire.first i,
.business-visual:is([data-story-step="2"], [data-story-step="3"]) .motion-wire.second i { animation: story-send 650ms ease-in-out both; }
.business-visual[data-story-step="2"] .motion-wire.second i { animation-delay: 440ms; }
.business-visual[data-story-step="3"] .motion-wire.third i { animation: story-send 500ms ease-in-out 760ms both; }

.mini-erp {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: .7rem;
  border: 1px solid var(--room-glass-edge);
  background: var(--room-surface);
  box-shadow: inset 0 1px var(--room-glass-rim), 0 3px 9px #0001;
}

.mini-erp img { width: 66%; height: auto; }
[data-story-step="2"] .connector-node .mini-erp { animation: active-station 920ms ease-out 430ms both; }

.mini-box { display: block; position: relative; width: 41px; height: 34px; margin-top: 5px; border: 1px solid #9a6735; border-radius: 4px; background: linear-gradient(145deg, #ebce9a, #bf894c 78%); box-shadow: 0 3px 6px #0002; }
.mini-box::before { content: ""; position: absolute; top: 0; left: 14px; width: 10px; height: 100%; background: #f3dcab91; }
.barcode { display: block; background: repeating-linear-gradient(90deg, #253333 0 1px, #fff 1px 2.5px, #253333 2.5px 4px, #fff 4px 6px); }
.mini-box .barcode { position: absolute; top: 12px; left: 5px; width: 20px; height: 12px; border: 2px solid #fff; }
.scan-spark { position: absolute; top: 19px; width: 35px; height: 2px; border-radius: 4px; background: #a5eb74; box-shadow: 0 0 7px #83cc63; opacity: 0; }
[data-story-step="1"] .scan-spark { animation: scan-barcode 600ms ease-in-out both; }

.mini-printer { position: relative; width: 52px; height: 34px; margin-top: 3px; border-radius: 5px 5px 7px 7px; border: 1px solid #333e46; background: linear-gradient(150deg, #636e77, #313943 71%); box-shadow: inset 0 1px #ffffff51, 0 3px 7px #0003; }
.printer-led { position: absolute; top: 6px; left: 7px; width: 5px; height: 5px; background: #e6af73; border-radius: 50%; }
.printer-slot { position: absolute; z-index: 2; top: 19px; left: 7px; right: 7px; height: 4px; border-radius: 4px; background: #162129; box-shadow: 0 -1px #6e7a84; }
.printed-label { position: absolute; z-index: 1; top: 22px; left: 13px; width: 25px; height: 26px; padding: 6px 3px 3px; border: 1px solid #c1c9c4; border-radius: 2px; background: #fff; opacity: 0; transform: translateY(-9px) scaleY(.12); transform-origin: top center; }
.printed-label .barcode { width: 100%; height: 7px; }
.printed-label::after { content: ""; display: block; position: absolute; bottom: 4px; left: 4px; width: 65%; height: 2px; background: #c6c9c5; }
[data-story-step="3"] .printer-led { background: #b7e689; }
[data-story-step="3"] .printed-label { opacity: 1; transform: none; animation: print-label 720ms cubic-bezier(.24,.7,.35,1) 130ms both; }

.mini-van { position: relative; display: block; width: 37px; height: 25px; margin: 7px 12px 0 0; border: 1px solid #657b81; border-radius: 4px 4px 1px 3px; background: linear-gradient(160deg, #dce7e4, #90aeb0); box-shadow: inset 0 2px #f3f8f5b8, 0 2px 4px #0002; }
.mini-van::before { position: absolute; top: 6px; left: 100%; width: 14px; height: 17px; border: 1px solid #657b81; border-radius: 0 9px 2px 0; background: linear-gradient(180deg, #646f7c 0 42%, #8da7a3 43%); content: ""; }
.mini-van::after { position: absolute; inset: 3px 6px 3px auto; width: 1px; background: #657b815c; content: ""; }
.mini-van i { position: absolute; left: 5px; bottom: -4px; width: 8px; height: 8px; border: 2px solid #373a3e; border-radius: 50%; background: #abb3b7; box-shadow: 30px 0 0 -1px #abb3b7, 30px 0 0 1px #373a3e; }
[data-story-step="3"] .mini-van { animation: van-pickup 1100ms cubic-bezier(.2,.6,.22,1) 700ms both; }

.receipt-scene, .market-scene, .factory-scene {
  display: grid;
  align-items: center;
  justify-content: center;
  min-height: 5.7rem;
  padding: .6rem clamp(.62rem, 2.2vw, 1.65rem);
  gap: clamp(.35rem, 1.25vw, .9rem);
  font-size: clamp(.68rem, 1.12vw, .87rem);
  line-height: 1.25;
  font-weight: 690;
}

.receipt-scene { grid-template-columns: minmax(0, 1.1fr) minmax(0, .62fr) minmax(0, 1.5fr); }
.receipt-slip, .receipt-order { position: relative; display: grid; align-content: center; gap: .3rem; min-height: 3.55rem; border-radius: .4rem; padding: .35rem .48rem; border: 1px solid var(--room-glass-edge); box-shadow: 0 3px 9px #0001; }
.receipt-slip { background: #f9f7f1; color: #303942; padding-bottom: .52rem; }
.receipt-slip::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 5px; background: radial-gradient(circle at 50% 100%, #81918b58 1.3px, transparent 1.8px) 0 100% / 6px 5px repeat-x; }
.receipt-slip strong { font-size: clamp(.82rem, 1.72vw, 1.3rem); line-height: 1.1; }
.receipt-stamp { position: absolute; inset: auto .34rem .3rem auto; padding: .14rem .24rem; border: 1px solid #5a8d34; border-radius: 3px; background: #edf6e4; color: #315c1f; opacity: 0; transform: rotate(-8deg); font-size: .72em; font-weight: 830; text-transform: uppercase; }
[data-story-step="1"] .receipt-stamp { opacity: 1; animation: stamp-payment 440ms cubic-bezier(.23,.69,.38,1) 140ms both; }
[data-story-step="2"] .receipt-stamp, [data-story-step="3"] .receipt-stamp { opacity: 1; }
.receipt-order { grid-template-columns: auto minmax(0, 1fr); align-items: center; background: var(--room-surface); }
.receipt-order img { grid-row: 1 / 3; width: clamp(17px, 2.5vw, 27px); height: auto; }
.receipt-order b { width: fit-content; padding: .1rem .32rem; border-radius: .25rem; font-size: .9em; line-height: 1.25; }
.order-open { background: #f3e6d8; color: #7f4c28; }
.order-paid { display: none; background: #e1f0d2; color: #2d591b; }
[data-story-step="3"] .order-open { display: none; }
[data-story-step="3"] .order-paid { display: block; animation: settle-result 480ms ease-out both; }
.receipt-transfer { position: relative; display: grid; place-items: center; min-height: 2.65rem; }
.receipt-transfer > i { width: 85%; border-top: 1px dashed color-mix(in srgb, var(--room-hand-ink) 34%, var(--room-line)); transform: rotate(-9deg); }
.flying-receipt { position: absolute; width: 1.12rem; height: 1.42rem; border-radius: 2px; border: 1px solid #9eacb8; background: repeating-linear-gradient(180deg, #e2e9e8 0 2px, #fafbf6 2px 5px); opacity: 0; }
[data-story-step="2"] .flying-receipt { animation: send-receipt 950ms cubic-bezier(.2,.61,.34,1) both; }

.market-scene { grid-template-columns: minmax(0, .95fr) minmax(0, .38fr) minmax(0, .95fr) minmax(0, .95fr); text-align: center; }
.market-stall { display: grid; justify-items: center; gap: .25rem; min-width: 0; color: var(--room-muted); }
.market-window { position: relative; display: grid; align-items: end; justify-items: center; width: min(100%, 5.7rem); min-height: 2.5rem; padding: .4rem; border: 1px solid #839ba7; border-radius: .36rem .36rem .26rem .26rem; background: linear-gradient(180deg, #e9f0f1, #a8bcc3); box-shadow: 0 3px 8px #0002; }
.market-window::before { content: ""; position: absolute; inset: 0 -.14rem auto; height: .62rem; border-radius: .35rem .35rem .22rem .22rem; background: repeating-linear-gradient(90deg, #829cc5 0 8px, #d5e1f2 8px 16px); }
.new-stall .market-window::before { background: repeating-linear-gradient(90deg, #86a673 0 8px, #dce9d1 8px 16px); }
.market-packet { display: block; position: relative; width: 1.25rem; height: .96rem; border: 1px solid #8d734f; border-radius: 2px; background: linear-gradient(150deg, #efd1a4, #c49463); }
.market-packet::after { content: ""; position: absolute; top: 0; left: 39%; width: .21rem; height: 100%; background: #7b8e6a; }
.new-stall .market-packet, .market-expands > .market-packet { opacity: 0; }
.market-expands { position: relative; color: var(--room-brand); font-size: 1.45rem; }
.market-expands > .market-packet { position: absolute; z-index: 2; left: 50%; top: 9%; }
.market-order { display: flex; align-items: center; justify-content: center; gap: .25rem; padding: .39rem .23rem; border: 1px solid var(--room-glass-edge); border-radius: .45rem; background: var(--room-surface); color: var(--room-ink); font-size: .89em; opacity: .4; }
.market-order img { width: clamp(12px, 2.2vw, 23px); height: auto; }
[data-story-step="0"] .new-stall, [data-story-step="0"] .market-expands { opacity: .42; }
[data-story-step="2"] .market-expands > .market-packet { animation: stock-the-shelf 770ms ease-in-out both; }
[data-story-step="2"] .new-stall .market-packet { opacity: 1; animation: settle-result 380ms ease-out 570ms both; }
[data-story-step="3"] .new-stall .market-packet, [data-story-step="3"] .market-order { opacity: 1; }
[data-story-step="3"] .market-order { animation: settle-result 570ms cubic-bezier(.19,.61,.28,1) both; }

.factory-scene { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr); }
.factory-readout { display: grid; gap: .3rem; align-content: center; min-height: 3.65rem; padding: .35rem; border-radius: .45rem; border: 1px solid #687e86; background: #304752; color: #e0ebde; text-align: center; box-shadow: inset 0 -3px #152b3570, 0 3px 7px #0002; }
.factory-readout strong { color: #d3eeae; font: 750 clamp(1.05rem, 2vw, 1.55rem)/1 var(--room-mono); }
.factory-readout small { font: 650 .49em/1.1 var(--room-sans); }
.erp-readout { background: var(--room-surface); border-color: var(--room-glass-edge); color: var(--room-muted); box-shadow: 0 3px 8px #0001; }
.erp-readout strong { color: var(--room-link); }
.erp-readout .final-count { display: none; }
[data-story-step="3"] .erp-readout .empty-count { display: none; }
[data-story-step="3"] .erp-readout .final-count { display: block; animation: settle-result 520ms ease-out both; }
.factory-belt { position: relative; display: grid; justify-items: center; align-content: end; min-height: 3.25rem; padding-bottom: .14rem; color: var(--room-muted); font-size: .88em; }
.factory-belt::before { content: ""; position: absolute; inset: 1.45rem 0 auto; height: 7px; border-radius: 99px; border: 1px solid #87989b; background: repeating-linear-gradient(90deg, #71888b 0 5px, #cad8d8 5px 9px); }
.factory-belt i { position: absolute; left: 11%; top: .66rem; width: .84rem; height: .78rem; border-radius: 2px; border: 1px solid #9a754f; background: linear-gradient(90deg, #dfb583 0 43%, #a2ab6b 44% 61%, #d0a678 62%); }
.factory-belt i:nth-child(2) { left: 38%; }
.factory-belt i:nth-child(3) { left: 65%; }
[data-story-step="2"] .factory-belt::before { animation: belt-rollers 650ms linear 2; }
[data-story-step="2"] .factory-belt i { animation: belt-package 1050ms ease-in-out both; }
[data-story-step="2"] .factory-belt i:nth-child(2) { animation-delay: 110ms; }
[data-story-step="2"] .factory-belt i:nth-child(3) { animation-delay: 200ms; }

@keyframes story-send { 0% { opacity: 0; left: 0; } 20%, 82% { opacity: 1; } 100% { opacity: 0; left: 100%; } }
@keyframes scan-barcode { 0% { opacity: 0; transform: translateY(-11px); } 25%, 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(11px); } }
@keyframes active-station { 55% { border-color: var(--room-brand); box-shadow: 0 0 18px color-mix(in srgb, var(--room-brand) 45%, transparent); } }
@keyframes print-label { from { opacity: .65; transform: translateY(-8px) scaleY(.05); } to { opacity: 1; transform: none; } }
@keyframes van-pickup { from { opacity: .5; transform: translateX(-14px); } to { opacity: 1; transform: translateX(7px); } }
@keyframes stamp-payment { from { opacity: 0; transform: rotate(-18deg) scale(1.75); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }
@keyframes send-receipt { 0% { opacity: 0; left: -10%; transform: translateY(.7rem) rotate(-16deg); } 22%, 74% { opacity: 1; } 100% { opacity: 0; left: 96%; transform: translateY(-.55rem) rotate(10deg); } }
@keyframes settle-result { from { opacity: 0; transform: translateY(7px) scale(.91); } to { opacity: 1; transform: none; } }
@keyframes stock-the-shelf { 0% { opacity: 0; transform: translate(-1.4rem, .5rem) rotate(-10deg); } 20%, 70% { opacity: 1; } 100% { opacity: 0; transform: translate(1.6rem, -.4rem) rotate(7deg); } }
@keyframes belt-rollers { to { background-position: 18px 0; } }
@keyframes belt-package { from { opacity: .5; transform: translateX(-6px); } 55% { opacity: 1; } to { opacity: 0; transform: translateX(18px); } }

@media (max-width: 52rem) {
  .business-flow { display: block; max-width: 44rem; padding-block: 1.6rem 2.4rem; }
  .business-visual { top: calc(var(--room-header) + .38rem); z-index: 2; width: min(100%, calc(calc(var(--tri-room-viewport-height, 100vh) * 0.47) + 7rem)); margin: 0 auto .2rem; box-shadow: 0 9px 20px color-mix(in srgb, var(--room-ink) 13%, transparent); }
  .business-step { min-height: clamp(14rem, calc(var(--tri-room-viewport-height, 100vh) * 0.35), 23rem); padding-block: 1.55rem; gap: .55rem; }
  .business-step .display { font-size: clamp(1.85rem, 6.9vw, 3rem); }
  .business-visual figcaption { min-height: calc(2lh + 1.38rem + 1px); }
  .business-app-mount .invisible-window.invisible-window--rail { --window-rail-width: 0px; --window-rail-gap: 0px; }
  .business-app-mount .invisible-window--rail > .invisible-window__rail { display: none; }
}

@media (max-width: 32rem) {
  .motion-mount { min-height: 4.65rem; }
  .motion-track { padding-block: .27rem .39rem; }
  .motion-object { transform: scale(.79); transform-origin: 50% 0; height: 2.75rem; }
  .motion-wire { margin-top: 1.26rem; }
  .business-visual figcaption { min-height: calc(2lh + 1.04rem + 1px); padding: .52rem .62rem; }
  .business-app-mount { width: 58%; right: 3.5%; bottom: 10%; }
  .business-app-head { padding: .46rem .48rem; }
  .business-app-details { padding: .09rem .42rem .24rem; }
  .business-app-details > div { min-height: 1.85rem; }
  .business-app-state { padding-inline: .25rem; }
}

@media (max-width: 52rem) and (max-height: 34rem) {
  .business-visual { width: min(100%, calc(calc(var(--tri-room-viewport-height, 100vh) * 0.45) + 2rem)); }
}

@media (min-width: 36rem) and (max-width: 52rem) and (max-height: 34rem) {
  .business-flow { display: grid; column-gap: 1.2rem; }
  .business-visual { margin: 0; width: min(100%, calc(calc(var(--tri-room-viewport-height, 100vh) * 0.58) + 1rem)); }
  .business-step .display { font-size: clamp(1.45rem, 4.1vw, 2.4rem); }
}

@media (max-width: 52rem) and (prefers-reduced-motion: reduce) {
  .business-visual { box-shadow: 0 4px 16px color-mix(in srgb, var(--room-ink) 10%, transparent); }
}
