/* =========================================================
   DEMO fax machine
   ========================================================= */
.machine-wrap { display: grid; place-items: center; }
.machine { position: relative; width: min(440px, 100%); display: grid; justify-items: center; padding-top: 260px; }
.slot-top, .slot-bottom { position: relative; width: 80%; height: 18px; z-index: 3; }
.slot { position: absolute; inset: 4px 0; border-radius: 99px; background: #050607; box-shadow: inset 0 3px 6px rgba(0,0,0,.6); }
.slot-top { margin-bottom: -9px; }
.slot-bottom { margin-top: -9px; }
.machine-body {
  position: relative; z-index: 2; width: 100%; background: linear-gradient(160deg, var(--peach-strong), var(--pink-strong));
  border-radius: 34px; padding: 36px 28px 28px; display: grid; gap: 18px; justify-items: center;
  box-shadow: 0 40px 70px -30px var(--shadow), inset 0 -6px 0 rgba(0,0,0,.08);
}
.m-screen { width: 100%; background: #10241f; color: #8ef0c2; border-radius: 12px; padding: 14px 16px; font: 600 .9rem var(--f-mono); letter-spacing: .06em; display: grid; gap: 10px; box-shadow: inset 0 0 20px rgba(0,0,0,.6); }
.m-bar { height: 6px; border-radius: 6px; background: rgba(142,240,194,.18); overflow: hidden; }
.m-bar i { display: block; height: 100%; width: 0; background: #8ef0c2; transition: width 1.6s linear; }
.machine[data-state="sending"] .m-bar i, .machine[data-state="done"] .m-bar i { width: 100%; }
.m-send[disabled] { opacity: .5; cursor: default; transform: none; }

.demo-paper {
  position: absolute; top: 10px; left: 50%; width: 62%; aspect-ratio: 8.5/10; translate: -50% 0; z-index: 1;
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 22px 20px; display: grid; gap: 8px; align-content: start;
  font-size: .82rem; box-shadow: 0 20px 40px -10px var(--shadow); cursor: grab; touch-action: none;
  transform: translateY(var(--dy, 0px)) rotate(var(--rot, -3deg)); transition: transform .4s var(--spring);
  clip-path: inset(0 0 var(--clip, 0%) 0);
}
.demo-paper.dragging { transition: none; cursor: grabbing; }
.dp-head { font: 700 .72rem var(--f-mono); letter-spacing: .14em; margin-bottom: 6px; }
.demo-paper i { height: 5px; background: var(--paper-line); border-radius: 3px; } .demo-paper i.s { width: 50%; }
.dp-sig { font: italic 1.3rem var(--f-serif); color: color-mix(in srgb, var(--signal) 62%, var(--text)); margin-top: 6px; }
.machine[data-state="sending"] .demo-paper { animation: feed 1.6s linear forwards; }
.machine[data-state="done"] .demo-paper { opacity: 0; }
@keyframes feed { from { transform: translateY(var(--dy, 0px)) rotate(0); } to { transform: translateY(260px) rotate(0); clip-path: inset(0 0 100% 0); } }
.machine[data-state="sending"] .demo-paper { clip-path: inset(0 0 0 0); }

.demo-receipt {
  position: relative; z-index: 1; width: 62%; background: var(--paper); font: 500 .76rem/1.4 var(--f-mono); padding: 0 18px;
  max-height: 0; overflow: hidden; transition: max-height 1.4s var(--ease), padding 1.4s var(--ease);
  box-shadow: 0 20px 30px -10px var(--shadow);
}
.machine[data-state="done"] .demo-receipt { max-height: 320px; padding: 22px 18px 24px; }
.demo-receipt p { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line-strong); padding: 6px 0; }
.dr-h { justify-content: center !important; font-weight: 700; letter-spacing: .12em; }
.demo-receipt .ok { margin: 0; width: auto; height: auto; background: none; color: #1f9d58; display: inline; font-size: inherit; }
.dr-again { margin-top: 14px; width: 100%; font: 600 .8rem var(--f-mono); border: 1.5px solid var(--text); background: none; color: var(--text); border-radius: 99px; padding: 9px; cursor: pointer; }

@media (max-width: 560px) {
  .machine { padding-top: 230px; }
}
