/* ============================================================
   Product story: an auto-playing walkthrough of the product.
   A round stage with a progress ring; each step plays a small
   animated scene of the real app, then moves to the next.
   Markup: see the "HOW IT WORKS" section in /raddecare.
   ============================================================ */

.story{padding:100px 32px;background:#fff;overflow:hidden}
.story-inner{max-width:1200px;margin:0 auto}
.story-head{text-align:center;margin-bottom:56px}
.story-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:72px;align-items:center}

/* ── Stage ───────────────────────────────────────────── */
.story-stage{position:relative;width:min(460px,100%);aspect-ratio:1;margin:0 auto}
.story-ring{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg)}
.story-ring circle{fill:none;stroke-width:1.2}
.story-ring .track{stroke:var(--story-track,#ede9fe)}
.story-ring .bar{stroke:url(#storyRingGrad);stroke-linecap:round;stroke-dasharray:301.6;stroke-dashoffset:301.6}
.story-disc{position:absolute;inset:5.5%;border-radius:50%;overflow:hidden;
  background:radial-gradient(120% 90% at 20% 10%,#c084fc 0%,#7c3aed 38%,#3b82f6 100%);
  box-shadow:0 30px 80px rgba(124,58,237,.25)}
.story-disc::after{content:'';position:absolute;inset:0;background:radial-gradient(60% 50% at 70% 85%,rgba(255,255,255,.25),transparent 70%)}
.story-play{position:absolute;right:6%;bottom:6%;width:62px;height:62px;border-radius:50%;border:0;cursor:pointer;
  background:#fff;box-shadow:0 0 0 10px #fff,0 6px 20px rgba(15,23,42,.18);display:flex;align-items:center;justify-content:center;color:#0f172a;z-index:3}
.story-play:focus-visible{outline:3px solid #7c3aed;outline-offset:4px}
.story-play svg{width:22px;height:22px}
.story-play .i-play{display:none}
.story-stage.is-paused .story-play .i-play{display:block}
.story-stage.is-paused .story-play .i-pause{display:none}

/* Scenes sit over the disc; only the active one shows. */
.story-scene{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;opacity:0;visibility:hidden;transition:opacity .45s ease,visibility 0s .45s;z-index:2}
.story-scene.is-active{opacity:1;visibility:visible;transition:opacity .45s ease}

/* ── Steps ───────────────────────────────────────────── */
.story-steps{display:flex;flex-direction:column;gap:6px;list-style:none}
.story-step{display:block;width:100%;text-align:left;border:0;background:none;cursor:pointer;font-family:inherit;padding:18px 20px 18px 22px;border-radius:14px;position:relative;color:#0f172a;transition:background .25s}
.story-step::before{content:'';position:absolute;left:0;top:18px;bottom:18px;width:3px;border-radius:3px;background:#e2e8f0}
.story-step .n{display:block;font-size:11px;font-weight:800;letter-spacing:1.2px;text-transform:uppercase;color:#94a3b8}
.story-step .t{display:block;font-size:clamp(18px,2vw,24px);font-weight:800;letter-spacing:-.5px;line-height:1.2;margin:4px 0 0;color:#94a3b8;transition:color .25s}
.story-step .d{display:block;font-size:14px;line-height:1.65;color:#64748b;max-height:0;overflow:hidden;opacity:0;transition:max-height .45s ease,opacity .35s ease,margin .35s ease}
.story-step:hover .t{color:#334155}
.story-step.is-active{background:var(--story-tint,#faf8ff)}
.story-step.is-active::before{background:linear-gradient(var(--story-a,#7c3aed),var(--story-b,#3b82f6))}
.story-step.is-active .n{color:var(--story-a,#7c3aed)}
.story-step.is-active .t{color:#0f172a}
.story-step.is-active .d{max-height:160px;opacity:1;margin-top:8px}
.story-step:focus-visible{outline:3px solid #7c3aed;outline-offset:2px}

/* ── Shared mini-app pieces ──────────────────────────── */
.mini{position:relative;width:68%;background:#fff;border-radius:16px;box-shadow:0 24px 60px rgba(15,23,42,.28);font-family:inherit;color:#0f172a;overflow:hidden}
.mini-bar{display:flex;align-items:center;gap:6px;padding:9px 12px;border-bottom:1px solid #f1f5f9;font-size:10px;font-weight:700;color:#64748b}
.mini-bar i{width:6px;height:6px;border-radius:50%;background:#e2e8f0;display:block}
.mini-bar span{margin-left:6px}
.mini-body{padding:12px}
.chip{display:inline-flex;align-items:center;gap:5px;font-size:10px;font-weight:800;padding:4px 9px;border-radius:999px;white-space:nowrap}
.chip.green{background:#dcfce7;color:#15803d}
.chip.purple{background:#ede9fe;color:#6d28d9}
.chip.amber{background:#fef3c7;color:#b45309}
.avatar{width:22px;height:22px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:9px;font-weight:800;color:#fff;background:#7c3aed;flex-shrink:0}
.float-card{position:absolute;background:#fff;border-radius:12px;box-shadow:0 14px 34px rgba(15,23,42,.22);padding:9px 12px;font-size:11px;font-weight:700;color:#0f172a;display:flex;align-items:center;gap:8px;z-index:3}

/* 1. Roster: a shift drops into the week, a worker joins, margin shows */
.s-roster .week{display:grid;grid-template-columns:repeat(5,1fr);gap:5px}
.s-roster .day{font-size:9px;font-weight:800;color:#94a3b8;text-align:center;padding-bottom:4px}
.s-roster .col{height:118px;background:#f8fafc;border-radius:8px;position:relative}
.s-roster .blk{position:absolute;left:3px;right:3px;border-radius:6px;background:#e0e7ff}
.s-roster .new{background:linear-gradient(135deg,#7c3aed,#6366f1);color:#fff;font-size:8px;font-weight:800;padding:5px 4px;line-height:1.3;opacity:0;transform:translateY(-40px)}
.s-roster .new .avatar{width:16px;height:16px;font-size:7px;background:#fff;color:#7c3aed;margin-top:4px;transform:scale(0)}
.s-roster .margin{right:-6%;top:13%;opacity:0;transform:translateY(12px)}
.is-active.s-roster .new{animation:dropIn .6s cubic-bezier(.2,.9,.3,1.3) .5s forwards}
.is-active.s-roster .new .avatar{animation:pop .4s cubic-bezier(.2,.9,.3,1.4) 1.4s forwards}
.is-active.s-roster .margin{animation:rise .5s ease 2.1s forwards}

/* 2. Clock in: phone, GPS pin, clocked in */
.s-clock .phone{position:relative;width:42%;aspect-ratio:9/17;background:#0f172a;border-radius:26px;padding:7px;box-shadow:0 24px 60px rgba(15,23,42,.35)}
.s-clock .screen{position:relative;width:100%;height:100%;border-radius:20px;overflow:hidden;background:linear-gradient(180deg,#eef2ff,#fff 55%)}
.s-clock .map{position:absolute;inset:0 0 45% 0;background:
  linear-gradient(90deg,transparent 48%,#dbeafe 48% 52%,transparent 52%),
  linear-gradient(0deg,transparent 60%,#dbeafe 60% 64%,transparent 64%),
  linear-gradient(30deg,transparent 30%,#e0e7ff 30% 33%,transparent 33%),#f1f5f9}
.s-clock .pin{position:absolute;left:50%;top:30%;width:14px;height:14px;margin:-7px;border-radius:50%;background:#7c3aed;box-shadow:0 0 0 4px rgba(124,58,237,.25)}
.s-clock .pin::after{content:'';position:absolute;inset:-4px;border-radius:50%;border:2px solid #7c3aed;opacity:0}
.is-active.s-clock .pin::after{animation:ping 1.4s ease-out .3s 3}
.s-clock .panel{position:absolute;left:8px;right:8px;bottom:10px}
.s-clock .who{font-size:9px;color:#64748b;font-weight:700}
.s-clock .shift{font-size:11px;font-weight:800;margin:2px 0 8px}
.s-clock .btn{position:relative;height:30px;border-radius:9px;background:#7c3aed;color:#fff;font-size:10px;font-weight:800;display:flex;align-items:center;justify-content:center;overflow:hidden}
.s-clock .btn b{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#16a34a;transform:translateY(100%)}
.is-active.s-clock .btn{animation:press .25s ease 1.6s}
.is-active.s-clock .btn b{animation:slideUp .35s ease 1.75s forwards}
.s-clock .gps{left:56%;top:22%;opacity:0;transform:translateY(10px)}
.s-clock .note{right:-10%;top:55%;opacity:0;transform:translateY(10px)}
.is-active.s-clock .gps{animation:rise .45s ease 1s forwards}
.is-active.s-clock .note{animation:rise .45s ease 2.6s forwards}

/* 3. Pay: timesheet lines tick in, total counts up */
.s-pay .row{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:10.5px;padding:7px 0;border-bottom:1px dashed #e2e8f0;opacity:0;transform:translateX(-12px)}
.s-pay .row .k{color:#334155;font-weight:600}
.s-pay .row .v{font-weight:800;font-variant-numeric:tabular-nums}
.s-pay .total{display:flex;justify-content:space-between;align-items:baseline;margin-top:10px;font-weight:800}
.s-pay .total .v{font-size:22px;letter-spacing:-.5px;color:#6d28d9;font-variant-numeric:tabular-nums}
.is-active.s-pay .row{animation:slideIn .4s ease forwards}
.is-active.s-pay .row:nth-child(1){animation-delay:.4s}
.is-active.s-pay .row:nth-child(2){animation-delay:.8s}
.is-active.s-pay .row:nth-child(3){animation-delay:1.2s}
.is-active.s-pay .row:nth-child(4){animation-delay:1.6s}
.s-pay .award{right:-6%;top:12%;opacity:0;transform:translateY(10px)}
.is-active.s-pay .award{animation:rise .45s ease 2.4s forwards}

/* 4. Invoice: invoice slides up, gets sent, NDIA claim file ready */
.s-invoice .paper{width:56%;background:#fff;border-radius:12px;padding:14px;box-shadow:0 24px 60px rgba(15,23,42,.28);transform:translateY(40px);opacity:0}
.s-invoice .ttl{font-size:12px;font-weight:800}
.s-invoice .sub{font-size:9px;color:#64748b;margin-bottom:10px}
.s-invoice .line{height:7px;border-radius:4px;background:#f1f5f9;margin:6px 0}
.s-invoice .line.w60{width:60%}.s-invoice .line.w80{width:80%}
.s-invoice .sum{display:flex;justify-content:space-between;font-size:11px;font-weight:800;margin-top:10px}
.s-invoice .stamp{position:absolute;right:10px;top:12px;font-size:9px;font-weight:900;letter-spacing:1px;color:#16a34a;border:2px solid #16a34a;border-radius:6px;padding:2px 6px;transform:rotate(-10deg) scale(2.4);opacity:0}
.s-invoice .mail{right:-2%;top:16%;opacity:0}
.s-invoice .claim{left:-4%;bottom:14%;opacity:0;transform:translateY(10px)}
.is-active.s-invoice .paper{animation:paperUp .6s cubic-bezier(.2,.9,.3,1) .3s forwards}
.is-active.s-invoice .stamp{animation:stamp .35s cubic-bezier(.3,1.6,.5,1) 1.5s forwards}
.is-active.s-invoice .mail{animation:fly 1.2s ease 2s forwards}
.is-active.s-invoice .claim{animation:rise .45s ease 2.7s forwards}

/* 5. Budget: category budgets drain as shifts are billed; an alert appears */
.s-budget .cat{margin:9px 0}
.s-budget .cat .top{display:flex;justify-content:space-between;font-size:10px;font-weight:700;color:#334155;margin-bottom:5px}
.s-budget .cat .top b{font-variant-numeric:tabular-nums}
.s-budget .track{height:9px;border-radius:9px;background:#f1f5f9;overflow:hidden}
.s-budget .fill{height:100%;width:0;border-radius:9px;background:linear-gradient(90deg,#7c3aed,#3b82f6)}
.s-budget .fill.warn{background:linear-gradient(90deg,#f59e0b,#ef4444)}
.is-active.s-budget .fill{animation:fill 1.6s cubic-bezier(.3,.7,.3,1) .5s forwards}
.s-budget .alert{left:-6%;bottom:12%;opacity:0;transform:translateY(10px)}
.is-active.s-budget .alert{animation:rise .45s ease 2.3s forwards}

/* Per-scene disc colour: a scene with data-disc paints its own disc, which
   fades in and out with the scene. */
.story-scene[data-disc]::before{content:'';position:absolute;inset:5.5%;border-radius:50%;background:var(--disc)}

/* Restaurant: a table is seated, the order lands on the kitchen screen */
.s-serve .floor{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.s-serve .tbl{aspect-ratio:1;border-radius:10px;background:#f1f5f9;border:2px solid #e2e8f0;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800;color:#94a3b8}
.s-serve .tbl.round{border-radius:50%}
.s-serve .tbl.busy{background:#fee2e2;border-color:#fca5a5;color:#b91c1c}
.s-serve .tbl.seat{transition:none}
.is-active.s-serve .tbl.seat{animation:seat .5s ease .7s forwards}
.s-serve .kds{right:-12%;top:44%;flex-direction:column;align-items:stretch;gap:4px;min-width:150px;opacity:0;transform:translate(-30px,20px) scale(.9)}
.s-serve .kds .h{display:flex;justify-content:space-between;font-size:10px;color:#64748b}
.s-serve .kds .h b{color:#ea580c}
.s-serve .kds .it{font-size:11px}
.is-active.s-serve .kds{animation:rise .55s cubic-bezier(.2,.9,.3,1.2) 1.6s forwards}
.s-serve .seated{left:-4%;top:14%;opacity:0;transform:translateY(10px)}
.is-active.s-serve .seated{animation:rise .45s ease 1s forwards}

/* Retail: a barcode is scanned, the item joins the sale, stock goes down */
.s-pos .scan{position:relative;height:54px;border-radius:10px;background:#f8fafc;display:flex;align-items:center;justify-content:center;overflow:hidden;margin-bottom:8px}
.s-pos .bars{width:62%;height:30px;background:repeating-linear-gradient(90deg,#0f172a 0 2px,transparent 2px 4px,#0f172a 4px 5px,transparent 5px 8px,#0f172a 8px 11px,transparent 11px 13px)}
.s-pos .laser{position:absolute;left:8%;right:8%;top:50%;height:2px;background:#ef4444;box-shadow:0 0 10px #ef4444;opacity:0}
.is-active.s-pos .laser{animation:laser 1s ease-in-out .4s 2}
.s-pos .line{display:flex;justify-content:space-between;font-size:10.5px;padding:6px 0;border-bottom:1px dashed #e2e8f0}
.s-pos .line.add{opacity:0;transform:translateX(-12px)}
.is-active.s-pos .line.add{animation:slideIn .4s ease 2.2s forwards}
.s-pos .tot{display:flex;justify-content:space-between;align-items:baseline;margin-top:8px;font-weight:800}
.s-pos .tot .v{font-size:20px;color:#047857;font-variant-numeric:tabular-nums}
.s-pos .stock{right:-6%;top:12%;opacity:0;transform:translateY(10px)}
.is-active.s-pos .stock{animation:rise .45s ease 2.6s forwards}

/* One platform: every product syncs into the books */
.s-sync .hub{position:relative;width:70%;aspect-ratio:1.25}
.s-sync .node{position:absolute;width:30%;aspect-ratio:1;border-radius:18px;background:#fff;box-shadow:0 14px 34px rgba(15,23,42,.25);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:9px;font-weight:800;color:#334155}
.s-sync .node span{font-size:20px}
.s-sync .n1{left:0;top:0}.s-sync .n2{right:0;top:0}.s-sync .n3{left:35%;top:0}
.s-sync .books{left:35%;bottom:0;background:#0f172a;color:#fff}
.s-sync svg.wires{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.s-sync .wires path{fill:none;stroke:rgba(255,255,255,.85);stroke-width:2;stroke-dasharray:4 6;stroke-dashoffset:0}
.is-active.s-sync .wires path{animation:flow 1s linear infinite}
.s-sync .dot{position:absolute;width:10px;height:10px;margin:-5px;border-radius:50%;background:#fff;box-shadow:0 0 12px #fff;opacity:0}
.is-active.s-sync .dot.d1{animation:travel1 1.6s ease-in-out .6s 3}
.is-active.s-sync .dot.d2{animation:travel2 1.6s ease-in-out 1.1s 3}
.s-sync .ok{left:-2%;bottom:13%;transform:translateY(10px);opacity:0}
.is-active.s-sync .ok{animation:rise .45s ease 2.4s forwards}

/* ── Keyframes ───────────────────────────────────────── */
@keyframes dropIn{to{opacity:1;transform:none}}
@keyframes pop{to{transform:scale(1)}}
@keyframes rise{to{opacity:1;transform:none}}
@keyframes slideIn{to{opacity:1;transform:none}}
@keyframes slideUp{to{transform:none}}
@keyframes press{50%{transform:scale(.94)}}
@keyframes ping{0%{transform:scale(.6);opacity:.9}100%{transform:scale(3);opacity:0}}
@keyframes paperUp{to{opacity:1;transform:none}}
@keyframes stamp{to{opacity:1;transform:rotate(-10deg) scale(1)}}
@keyframes fly{0%{opacity:0;transform:translate(-40px,30px) scale(.8)}25%{opacity:1;transform:none}75%{opacity:1;transform:none}100%{opacity:1;transform:none}}
@keyframes fill{to{width:var(--to)}}
@keyframes seat{to{background:#fee2e2;border-color:#f87171;color:#b91c1c;transform:scale(1.06)}}
@keyframes laser{0%{opacity:0;top:15%}20%{opacity:1}80%{opacity:1}100%{opacity:0;top:85%}}
@keyframes flow{to{stroke-dashoffset:-20}}
@keyframes travel1{0%{opacity:0;left:15%;top:37%}15%{opacity:1}85%{opacity:1}100%{opacity:0;left:50%;top:63%}}
@keyframes travel2{0%{opacity:0;left:85%;top:37%}15%{opacity:1}85%{opacity:1}100%{opacity:0;left:50%;top:63%}}

/* ── Small screens: stage on top, steps below ────────── */
@media(max-width:900px){
  .story{padding:72px 16px}
  .story-grid{grid-template-columns:1fr;gap:36px}
  .story-stage{width:min(360px,100%)}
  .story-play{width:52px;height:52px;box-shadow:0 0 0 8px #fff,0 6px 20px rgba(15,23,42,.18)}
  .mini{width:74%}
  .float-card{font-size:10px;padding:7px 10px;max-width:64%}
  /* keep floating cards inside the screen */
  .s-roster .margin,.s-clock .note,.s-pay .award,.s-invoice .mail{right:0}
  .s-invoice .claim,.s-budget .alert,.s-serve .seated,.s-sync .ok{left:0}
  .s-serve .kds,.s-pos .stock{right:0}
  .s-clock .gps{left:auto;right:0}
}

/* Reduced motion: no autoplay, scenes appear in their finished state. */
@media (prefers-reduced-motion: reduce){
  .story-scene,.story-step .d{display:block;transition:none}
  .story-scene *,.story-scene *::before,.story-scene *::after{animation-duration:1ms!important;animation-delay:0s!important;animation-iteration-count:1!important}
}
