/* Three tactile stories: real progress, enquiries that arrive, a price agreed upfront.
   Base styles always show the finished, happy scene. When Datastar adds .story-start
   (article enters the viewport), each scene replays its pain and resolves in 3.5 to 4.7 s.
   All motion lives inside @media (prefers-reduced-motion: no-preference). */

.story-section {
  margin-block: 65px 90px;
}
.story-section > h2 {
  font-size: clamp(38px, 5vw, 62px);
  letter-spacing: -0.06em;
  line-height: 1.03;
  margin-bottom: 35px;
}
.story-list {
  display: grid;
  gap: 28px;
}
.story-item {
  --d-enter: 600ms;
  --d-pop: 500ms;
  --d-message: 450ms;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 16px;
  min-height: 520px;
  border-radius: 32px;
  background: #e5f4be;
  overflow: hidden;
}
.story-copy {
  padding: 48px 16px 48px 48px;
}
.story-copy h3 {
  font-size: clamp(34px, 3.8vw, 50px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  max-width: 17ch;
}
.story-copy p {
  margin-top: 18px;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.45;
  font-weight: 500;
  max-width: 30ch;
  color: #3f4538;
}
.story-stage {
  position: relative;
  min-width: 0;
}

/* Shared chat pieces. One colour per sender everywhere:
   you (the owner) lime, another developer grey, Mykolas charcoal. */
.story-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #20221d14;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.story-chat-head small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.story-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 850;
}
.story-avatar.is-them {
  background: #d6d8cd;
  color: #5a5e53;
}
.story-avatar.is-mykolas {
  background: var(--coral);
  color: var(--ink);
}
.story-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
}
.story-msg {
  max-width: 92%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.35;
}
.story-msg.is-you {
  align-self: flex-end;
  background: var(--lime);
  color: var(--ink);
  border-bottom-right-radius: 4px;
}
.story-msg.is-them {
  align-self: flex-start;
  background: #dfe1d6;
  color: #3f433a;
  border-bottom-left-radius: 4px;
}
.story-msg.is-mykolas {
  align-self: flex-start;
  background: var(--ink);
  color: var(--paper);
  border-bottom-left-radius: 4px;
  font-weight: 650;
}

/* Story 1: see real progress. A stalled chat behind, a phone with a working preview in front. */
.story-progress {
  --t-ask: 250ms; /* the owner asks Mykolas */
  --t-stall-1: 800ms; /* first "Almost done." */
  --t-stall-2: 1800ms;
  --t-stall-3: 2600ms;
  --t-clock: 900ms; /* the clock starts racing */
  --t-reply: 1100ms; /* Mykolas sends the preview */
  --t-open: 1900ms; /* the preview opens on the phone */
  --t-tap: 2700ms; /* the owner taps Book */
  --t-booked: 3150ms; /* confirmation pops */
  --d-bubble: 450ms;
  --d-phone: 750ms;
  --d-clock: 1900ms;
  --d-preview: 650ms;
}
.story-progress .story-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 540px;
  padding: 44px 36px 0 8px;
}
.story-stall {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  width: min(100%, 262px);
  margin: 18px -46px 0 0;
  padding: 18px 18px 20px;
  border-radius: 22px;
  background: #f0f0ea;
  box-shadow: 0 14px 30px #20221d14;
  transform: rotate(-5deg);
}
.story-stall .story-chat-head {
  color: #3f433a;
}
.story-clock {
  position: absolute;
  left: -18px;
  bottom: -16px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--ink);
  box-shadow: 0 8px 18px #20221d1f;
  transform: rotate(-10deg);
}
.story-clock svg {
  width: 32px;
  height: 32px;
}
.story-clock-hand {
  transform-box: view-box;
  transform-origin: 12px 12px;
}
.story-phone {
  position: relative;
  z-index: 2;
  width: min(100%, 264px);
  margin-bottom: -18px;
  padding: 14px;
  border-radius: 40px;
  background: var(--ink);
  box-shadow: 0 24px 50px #20221d2e;
  transform: rotate(-2deg);
}
.story-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 470px;
  padding: 18px 14px 14px;
  border-radius: 28px;
  background: #fffef8;
  overflow: hidden;
}
.story-screen .story-chat-head strong {
  font-size: 17px;
}
.story-sheet {
  margin-top: auto;
  padding: 16px;
  border-radius: 20px 20px 16px 16px;
  background: #eef0e4;
}
.story-sheet-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 14px;
}
.story-sheet-bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c4c8ba;
}
.story-sheet-bar span {
  flex: 1;
  height: 10px;
  margin-left: 6px;
  border-radius: 99px;
  background: #dcdfd2;
}
.story-sheet > strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.story-pills {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.story-pills span {
  flex: 1;
  padding: 8px 0;
  border-radius: 99px;
  background: #fffef8;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.story-pills .is-picked {
  background: var(--ink);
  color: var(--lime);
}
.story-action {
  display: grid;
  margin-top: 12px;
}
.story-action > * {
  grid-area: 1 / 1;
}
.story-cta,
.story-done {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 99px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.story-cta {
  background: var(--lime);
  color: var(--ink);
  opacity: 0; /* the booking is already done in the finished scene */
}
.story-done {
  background: var(--ink);
  color: var(--lime);
}
.story-done svg {
  width: 22px;
  height: 22px;
}

/* Story 2: a customer writes, you get it. Form, flight path and inbox on charcoal. */
.story-inbox {
  --d-send: 350ms;
  --t-tray: 150ms;
  --d-deliver: 550ms;
  --t-send: 100ms; /* Send is pressed */
  --t-flight: 350ms; /* the plane leaves the form */
  --d-flight: 2500ms; /* whole flight including the stall */
  --t-connect: 1450ms; /* the lime line starts drawing */
  --d-connect: 750ms;
  --t-arrive: 2750ms; /* the enquiry lands in the tray */
  --t-tick: 3100ms; /* delivered tick */
  --t-reply: 3500ms; /* the owner replies */
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 0;
  background: var(--ink);
  color: var(--paper);
}
.story-inbox .story-copy {
  padding: 48px 48px 8px;
}
.story-inbox .story-copy h3 {
  max-width: 20ch;
}
.story-inbox .story-copy p {
  color: #c9cdbf;
  max-width: 40ch;
}
.story-inbox .story-stage {
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(90px, 1fr) minmax(
      250px,
      340px
    );
  align-items: stretch;
  min-height: 330px;
  padding: 16px 48px 52px;
}
.story-form {
  position: relative;
  z-index: 1;
  align-self: start;
  margin-top: 8px;
  padding: 18px;
  border-radius: 22px;
  background: #fffef8;
  color: var(--ink);
  box-shadow: 0 16px 36px #0000002e;
  transform: rotate(-4deg);
}
.story-form-bar {
  display: flex;
  gap: 5px;
  padding-bottom: 14px;
}
.story-form-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d9dbd0;
}
.story-lines p {
  min-height: 80px;
  padding: 14px;
  border-radius: 12px;
  background: #eef0e4;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}
.story-send {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 11px 18px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--lime);
  font-size: 15px;
  font-weight: 800;
}
.story-send svg {
  width: 18px;
  height: 18px;
}
.story-flight {
  align-self: center;
  width: calc(100% + 80px);
  height: auto;
  margin: 24px -40px 0;
  overflow: visible;
}
.story-guide {
  fill: none;
  stroke: #6b705f;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 3 8;
}
.story-link {
  fill: none;
  stroke: var(--lime);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0; /* connected */
}
.story-plane {
  transform-box: fill-box;
  transform-origin: center;
  transform: translate(294px, 106px) rotate(-12deg); /* landed at the inbox */
}
.story-tray {
  position: relative;
  z-index: 1;
  align-self: end;
  padding: 18px 18px 22px;
  border-radius: 26px;
  background: #fffef8;
  color: var(--ink);
  box-shadow: 0 20px 44px #00000040;
  transform: rotate(2deg);
}
.story-tray-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.story-tray-head svg {
  width: 22px;
  height: 22px;
}
.story-tray-head i {
  width: 10px;
  height: 10px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--coral);
}
.story-slot {
  position: relative;
}
.story-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dashed #c8ccbd;
  border-radius: 18px;
}
.story-mail {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 14px;
  border-radius: 18px;
  background: #eef0e4;
}
.story-mail .story-avatar {
  background: #f7d7cd;
  color: var(--ink);
}
.story-mail .story-avatar svg {
  width: 20px;
  height: 20px;
}
.story-mail strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.story-mail p {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.35;
  color: #4c5143;
}
.story-tick {
  position: absolute;
  top: -16px;
  right: -14px;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  box-shadow: 0 8px 18px #0000003a;
}
.story-tick svg {
  width: 26px;
  height: 26px;
}
.story-reply {
  position: absolute;
  right: 16px;
  bottom: -24px;
  max-width: 78%;
  box-shadow: 0 10px 24px #0000003a;
}

/* Story 3: know the price before the work. Receipt, surprise slips and a stamper on coral. */
.story-price {
  --d-receipt: 700ms;
  --d-thud: 320ms;
  --d-imprint: 120ms;
  --t-pile: 150ms; /* first surprise slip drops */
  --d-pile: 2900ms; /* a slip's whole life: drop, pile up, tuck into its row */
  --stagger: 260ms;
  --t-check: 2800ms; /* first row ticked */
  --t-stamp: 3450ms; /* the stamper comes down */
  --d-stamp: 1200ms;
  --t-imprint: 3880ms; /* imprint appears when the stamper hits, 36% into its move */
  --rest-x: 78px; /* where the stamper rests, from the imprint centre */
  --rest-y: -290px;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  background: #f7d7cd;
}
.story-price .story-copy {
  order: 2;
  padding: 48px 48px 48px 16px;
}
.story-price .story-copy p {
  color: #4c4039;
}
.story-price .story-stage {
  order: 1;
  display: grid;
  place-items: center;
  min-height: 500px;
  padding: 56px 40px 40px;
}
.story-paper {
  position: relative;
  width: min(100%, 340px);
}
.story-receipt {
  position: relative;
  padding: 26px 26px 54px;
  color: var(--ink);
  filter: drop-shadow(0 18px 22px #7a2f1f2e);
  transform: rotate(2deg);
}
.story-receipt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #fffef8;
  clip-path: polygon(
    0 0,
    100% 0,
    100% 96%,
    95% 100%,
    90% 96%,
    85% 100%,
    80% 96%,
    75% 100%,
    70% 96%,
    65% 100%,
    60% 96%,
    55% 100%,
    50% 96%,
    45% 100%,
    40% 96%,
    35% 100%,
    30% 96%,
    25% 100%,
    20% 96%,
    15% 100%,
    10% 96%,
    5% 100%,
    0 96%
  );
}
.story-receipt > strong {
  display: block;
  margin-bottom: 12px;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.story-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 50px;
  padding: 6px 0;
  border-bottom: 1px dashed #d3d7cb;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.story-ok {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--lime);
}
.story-ok svg {
  width: 20px;
  height: 20px;
}
.story-q {
  position: absolute;
  right: 6px;
  top: 50%;
  translate: 0 -50%;
  font-size: 26px;
  font-weight: 900;
  color: #b8452c;
  opacity: 0; /* no open questions in the finished scene */
}
.story-stamp {
  position: relative;
  display: table;
  margin: 24px 6px 0 auto;
}
.story-stamp-ink {
  display: block;
  padding: 8px 16px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--lime);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.2;
  transform: rotate(-7deg);
}
.story-stamper {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92px;
  height: 70px;
  overflow: visible;
  transform: translate(calc(-50% + var(--rest-x)), calc(-50% + var(--rest-y)))
    rotate(14deg);
}
.story-slip {
  position: absolute;
  right: -15px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 112px;
  height: 66px;
  border: 3px solid #fffef8;
  border-radius: 14px;
  background: var(--coral);
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: 0 10px 22px #7a2f1f33;
  opacity: 0; /* surprises are gone in the finished scene */
}
.story-slip.slip-1 {
  top: 56px;
  --pile-x: -100px;
  --pile-y: 40px;
  --pile-r: -12deg;
}
.story-slip.slip-2 {
  top: 106px;
  --pile-x: -150px;
  --pile-y: 36px;
  --pile-r: 8deg;
}
.story-slip.slip-3 {
  top: 156px;
  --pile-x: -70px;
  --pile-y: 60px;
  --pile-r: -4deg;
}

/* Closing care line: one sentence, not a card. */
.story-care {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 54ch;
  margin-top: 36px;
  padding: 0 8px;
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.story-care-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--lime);
  transform: rotate(-8deg);
}
.story-care-icon svg {
  width: 28px;
  height: 28px;
}

/* Motion. Every animation is finite and only runs after .story-start lands on the article. */
@media (prefers-reduced-motion: no-preference) {
  /* Story 1 */
  .story-start .story-stall {
    animation: story-stall-in var(--d-enter) cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .story-start .story-stall .story-msg {
    animation: story-msg-in var(--d-bubble) both;
  }
  .story-start .story-stall .story-msg:nth-child(1) {
    animation-delay: var(--t-stall-1);
  }
  .story-start .story-stall .story-msg:nth-child(2) {
    animation-delay: var(--t-stall-2);
  }
  .story-start .story-stall .story-msg:nth-child(3) {
    animation-delay: var(--t-stall-3);
  }
  .story-start .story-clock {
    animation: story-pop var(--d-pop) var(--t-ask) both;
  }
  .story-start .story-clock-hand {
    animation: story-clock-sweep var(--d-clock) var(--t-clock)
      cubic-bezier(0.5, 0, 0.3, 1) both;
  }
  .story-start .story-phone {
    animation: story-phone-land var(--d-phone) cubic-bezier(0.2, 0.8, 0.2, 1)
      both;
  }
  .story-start .story-screen .story-msg:nth-child(1) {
    animation: story-msg-in var(--d-bubble) var(--t-ask) both;
  }
  .story-start .story-screen .story-msg:nth-child(2) {
    animation: story-msg-in var(--d-bubble) var(--t-reply) both;
  }
  .story-start .story-sheet {
    animation: story-sheet-up var(--d-preview) var(--t-open)
      cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .story-start .story-cta {
    animation: story-cta-tap var(--d-message) var(--t-tap) both;
  }
  .story-start .story-done {
    animation: story-pop var(--d-pop) var(--t-booked) both;
  }

  /* Story 2 */
  .story-start .story-form {
    animation: story-form-in var(--d-enter) cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .story-start .story-send {
    animation: story-send-press var(--d-send) var(--t-send) both;
  }
  .story-start .story-plane {
    animation: story-plane-flight var(--d-flight) var(--t-flight) both;
  }
  .story-start .story-link {
    animation: story-link-draw var(--d-connect) var(--t-connect) ease-in-out
      both;
  }
  .story-start .story-tray {
    animation: story-tray-in var(--d-enter) var(--t-tray)
      cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .story-start .story-mail {
    animation: story-mail-land var(--d-deliver) var(--t-arrive)
      cubic-bezier(0.2, 0.8, 0.2, 1.2) both;
  }
  .story-start .story-tick {
    animation: story-pop var(--d-pop) var(--t-tick) both;
  }
  .story-start .story-reply {
    animation: story-msg-in var(--d-pop) var(--t-reply) both;
  }

  /* Story 3 */
  .story-start .story-receipt {
    animation:
      story-receipt-settle var(--d-receipt) cubic-bezier(0.2, 0.8, 0.2, 1) both,
      story-receipt-thud var(--d-thud) var(--t-imprint) ease-in-out both;
  }
  .story-start .story-slip {
    animation: story-slip-life var(--d-pile) var(--t-pile) both;
  }
  .story-start .story-slip.slip-2 {
    animation-delay: calc(var(--t-pile) + var(--stagger));
  }
  .story-start .story-slip.slip-3 {
    animation-delay: calc(var(--t-pile) + var(--stagger) * 2);
  }
  .story-start .story-q {
    animation: story-q-away var(--t-check) both;
  }
  .story-start .row-2 .story-q {
    animation-duration: calc(var(--t-check) + var(--stagger));
  }
  .story-start .row-3 .story-q {
    animation-duration: calc(var(--t-check) + var(--stagger) * 2);
  }
  .story-start .story-ok {
    animation: story-pop var(--d-message) var(--t-check) both;
  }
  .story-start .row-2 .story-ok {
    animation-delay: calc(var(--t-check) + var(--stagger));
  }
  .story-start .row-3 .story-ok {
    animation-delay: calc(var(--t-check) + var(--stagger) * 2);
  }
  .story-start .story-stamper {
    animation: story-stamper-press var(--d-stamp) var(--t-stamp) both;
  }
  .story-start .story-stamp-ink {
    animation: story-imprint var(--d-imprint) var(--t-imprint) both;
  }
}
@keyframes story-msg-in {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.85);
  }
  75% {
    opacity: 1;
    transform: translateY(-2px) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes story-pop {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-20deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.12) rotate(4deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}
@keyframes story-stall-in {
  from {
    opacity: 0;
    transform: translateX(-50px) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: rotate(-5deg);
  }
}
@keyframes story-clock-sweep {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(720deg);
  }
}
@keyframes story-phone-land {
  from {
    transform: translateY(80px) rotate(-7deg);
  }
  to {
    transform: translateY(0) rotate(-2deg);
  }
}
@keyframes story-sheet-up {
  from {
    transform: translateY(115%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes story-cta-tap {
  0%,
  40% {
    opacity: 1;
    transform: scale(1);
  }
  60% {
    opacity: 1;
    transform: scale(0.92);
  }
  100% {
    opacity: 0;
    transform: scale(0.92);
  }
}
@keyframes story-form-in {
  from {
    opacity: 0;
    transform: translateX(-40px) rotate(-9deg);
  }
  to {
    opacity: 1;
    transform: rotate(-4deg);
  }
}
@keyframes story-send-press {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.9);
  }
}
@keyframes story-plane-flight {
  0% {
    transform: translate(14px, 44px) rotate(10deg);
    animation-timing-function: ease-out;
  }
  30% {
    transform: translate(122px, 8px) rotate(-14deg);
    animation-timing-function: ease-in;
  }
  44% {
    transform: translate(158px, 46px) rotate(40deg);
    animation-timing-function: linear;
  }
  60% {
    transform: translate(164px, 64px) rotate(52deg);
    animation-timing-function: cubic-bezier(0.75, 0, 0.25, 1);
  }
  100% {
    transform: translate(294px, 106px) rotate(-12deg);
  }
}
@keyframes story-link-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes story-tray-in {
  from {
    opacity: 0;
    transform: translateY(40px) rotate(5deg);
  }
  to {
    opacity: 1;
    transform: rotate(2deg);
  }
}
@keyframes story-mail-land {
  from {
    opacity: 0;
    transform: translateY(-70px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes story-receipt-settle {
  from {
    opacity: 0;
    transform: translateY(-40px) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: rotate(2deg);
  }
}
@keyframes story-receipt-thud {
  0%,
  100% {
    translate: 0 0;
  }
  40% {
    translate: 0 5px;
  }
}
@keyframes story-slip-life {
  0% {
    opacity: 0;
    transform: translate(var(--pile-x), -360px)
      rotate(calc(var(--pile-r) - 30deg));
    animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
  }
  18% {
    opacity: 1;
    transform: translate(var(--pile-x), var(--pile-y)) rotate(var(--pile-r));
    animation-timing-function: ease-out;
  }
  23% {
    transform: translate(var(--pile-x), calc(var(--pile-y) - 7px))
      rotate(var(--pile-r));
    animation-timing-function: ease-in;
  }
  28% {
    transform: translate(var(--pile-x), var(--pile-y)) rotate(var(--pile-r));
    animation-timing-function: linear;
  }
  64% {
    opacity: 1;
    transform: translate(var(--pile-x), var(--pile-y)) rotate(var(--pile-r));
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }
  92% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(0.45);
    animation-timing-function: ease-in;
  }
  100% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg) scale(0.15);
  }
}
@keyframes story-q-away {
  0%,
  65% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
    transform: translateY(-12px) scale(0.6);
  }
}
@keyframes story-stamper-press {
  0% {
    transform: translate(calc(-50% + var(--rest-x)), calc(-50% + var(--rest-y)))
      rotate(14deg);
    animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4);
  }
  36% {
    transform: translate(-50%, -50%) rotate(-7deg) scale(1);
    animation-timing-function: ease-out;
  }
  44% {
    transform: translate(-50%, -46%) rotate(-7deg) scale(1.04, 0.9);
    animation-timing-function: ease-in-out;
  }
  58% {
    transform: translate(-50%, -50%) rotate(-7deg) scale(1);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
  }
  100% {
    transform: translate(calc(-50% + var(--rest-x)), calc(-50% + var(--rest-y)))
      rotate(14deg);
  }
}
@keyframes story-imprint {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Tablet: every story becomes one column, copy first. */
@media (max-width: 950px) {
  .story-item,
  .story-price {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 0;
    gap: 0;
  }
  .story-copy,
  .story-price .story-copy,
  .story-inbox .story-copy {
    order: 1;
    padding: 36px 34px 8px;
  }
  .story-copy h3 {
    max-width: 20ch;
  }
  .story-copy p {
    max-width: 44ch;
  }
  .story-stage,
  .story-price .story-stage {
    order: 2;
  }
  .story-progress .story-stage {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 24px 28px 0;
  }
  .story-stall {
    align-self: flex-start;
    width: min(100%, 290px);
    margin: 0 0 -26px;
    padding-bottom: 28px;
  }
  .story-clock {
    left: auto;
    right: -16px;
    top: -18px;
    bottom: auto;
  }
  .story-phone {
    align-self: flex-end;
    width: min(100%, 258px);
    margin-bottom: -24px;
  }
  .story-inbox .story-stage {
    grid-template-columns: 1fr;
    padding: 12px 34px 54px;
  }
  .story-form {
    justify-self: start;
    width: min(100%, 250px);
  }
  .story-flight {
    width: 100%;
    margin: -14px 0 -10px;
  }
  .story-price .story-stage {
    min-height: 0;
    padding: 68px 28px 36px; /* room for the resting stamper above the receipt */
  }
  .story-price {
    --rest-x: 70px;
  }
  .story-care {
    align-items: flex-start;
    margin-top: 30px;
    padding: 0 4px;
  }
  .story-care-icon {
    width: 46px;
    height: 46px;
  }
}

/* Tablets retain a compact comparison and a single enquiry journey. */
@media (min-width: 651px) and (max-width: 950px) {
  .story-progress .story-stage {
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    min-height: 500px;
    padding: 24px 34px 0;
  }
  .story-stall {
    align-self: flex-start;
    width: min(44%, 262px);
    margin: 30px 0 0;
  }
  .story-phone {
    align-self: flex-end;
    width: 258px;
    margin-bottom: -18px;
  }
  .story-inbox .story-stage {
    grid-template-columns: minmax(165px, 1fr) minmax(48px, 0.5fr) minmax(
        230px,
        1.1fr
      );
    align-items: center;
    min-height: 300px;
    padding: 24px 34px 50px;
  }
  .story-form {
    width: auto;
  }
  .story-flight {
    width: calc(100% + 64px);
    margin: 24px -32px 0;
  }
}

/* Phones. */
@media (max-width: 650px) {
  .story-section {
    margin-block: 45px 65px;
  }
  .story-section > h2 {
    font-size: 42px;
    margin-bottom: 26px;
  }
  .story-list {
    gap: 20px;
  }
  .story-item {
    border-radius: 28px;
  }
  .story-copy,
  .story-price .story-copy,
  .story-inbox .story-copy {
    padding: 28px 24px 4px;
  }
  .story-copy h3 {
    font-size: 34px;
  }
  .story-copy p {
    font-size: 16px;
    margin-top: 14px;
  }
  .story-progress .story-stage {
    padding: 20px 20px 0;
  }
  .story-stall {
    margin-bottom: -22px;
    padding-bottom: 26px;
  }
  .story-phone {
    margin-bottom: -20px;
  }
  .story-screen {
    min-height: 440px;
  }
  .story-inbox .story-stage {
    padding: 8px 20px 50px;
  }
  .story-reply {
    right: 10px;
    bottom: -22px;
    max-width: 82%;
  }
  .story-price .story-stage {
    padding: 68px 20px 32px;
  }
  .story-receipt {
    padding: 22px 22px 50px;
  }
  .story-row {
    font-size: 15px;
  }
  .story-stamp-ink {
    font-size: 20px;
  }
  .story-care {
    font-size: 17px;
    gap: 14px;
    margin-top: 26px;
  }
}
@media (max-width: 380px) {
  .story-copy h3 {
    font-size: 31px;
  }
  .story-slip {
    width: 96px;
    height: 58px;
    font-size: 26px;
  }
  .story-slip.slip-2 {
    --pile-x: -120px;
  }
  .story-price {
    --rest-x: 60px;
    --rest-y: -282px;
  }
  .story-stamper {
    width: 80px;
    height: 61px;
  }
}
