/* Homepage "Will it work on your machines?" as a short video-style story (fit-home.js).
   Four stories (FANUC / other brand / old machine / rotomolding). Each plays: machine switches on ->
   signal to the gateway -> signal to the phone -> phone shows it live. Progress bars like stories. */
.hfs { position: relative; padding: 18px 18px 16px; border-radius: 24px; background: radial-gradient(120% 90% at 20% 0%, #173250 0%, #0b2036 55%, #08182a 100%); color: #e8eef5; box-shadow: 0 34px 70px -34px rgba(11,32,54,.85); overflow: hidden; }
.hfs-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hfs-tab { position: relative; display: grid; gap: 1px; padding: 9px 10px 12px; border: 0; border-radius: 12px; background: rgba(255,255,255,.05); color: #9fb1c4; text-align: left; font: 500 12px Inter, sans-serif; cursor: pointer; transition: background .2s, color .2s; }
.hfs-tab b { font-size: 14px; color: #dfe7ef; font-weight: 700; }
.hfs-tab[aria-selected="true"] { background: rgba(247,134,30,.16); color: #ffcf9a; }
.hfs-tab[aria-selected="true"] b { color: #fff; }
.hfs-tab:focus-visible { outline: 2px solid #f7861e; outline-offset: 2px; }
.hfs-bar { position: absolute; left: 10px; right: 10px; bottom: 5px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.hfs-bar i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: #f7861e; }
.hfs-tab.done .hfs-bar i { transform: scaleX(1); }
.hfs-tab[aria-selected="true"] .hfs-bar i { animation: hfsBar var(--dur, 6s) linear forwards; }
.hfs.paused .hfs-tab[aria-selected="true"] .hfs-bar i { animation-play-state: paused; }
.hfs.still .hfs-tab[aria-selected="true"] .hfs-bar i { animation: none; transform: scaleX(1); }
@keyframes hfsBar { to { transform: scaleX(1); } }

.hfs-stage { position: relative; display: grid; grid-template-columns: 1.25fr .9fr .75fr .6fr 1fr; align-items: center; min-height: 250px; margin-top: 14px; padding: 18px 14px 10px; border-radius: 18px; background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)), repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 34px), repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 34px); }
.hfs-sample { position: absolute; top: 10px; left: 12px; padding: 2px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,.18); font: 700 9.5px Inter, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #9fb1c4; }
.hfs figure { margin: 0; position: relative; display: grid; justify-items: center; gap: 8px; }
.hfs figcaption { font: 700 12px Inter, sans-serif; color: #b9c7d6; text-align: center; white-space: nowrap; }
.hfs-mframe { display: grid; place-items: end center; width: 100%; height: 150px; }
.hfs-mimg { max-width: 100%; max-height: 150px; width: auto; height: auto; object-fit: contain; filter: grayscale(.85) brightness(.6) drop-shadow(0 16px 18px rgba(0,0,0,.5)); transition: filter .6s, transform .6s cubic-bezier(.16,1,.3,1); transform: translateY(6px) scale(.97); }
.hfs-m.photo .hfs-mimg { border-radius: 14px; max-height: 140px; aspect-ratio: 1; object-fit: cover; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.hfs.s1 .hfs-mimg { filter: grayscale(0) brightness(1) drop-shadow(0 16px 18px rgba(0,0,0,.5)); transform: none; }
.hfs-lamp { position: absolute; top: 6px; right: 14%; width: 12px; height: 12px; border-radius: 50%; background: #3a4552; box-shadow: 0 0 0 3px rgba(255,255,255,.08); transition: background .3s, box-shadow .3s; }
.hfs.s1 .hfs-lamp { background: #22b26b; box-shadow: 0 0 0 3px rgba(34,178,107,.25), 0 0 14px #22b26b; }

.hfs-link { position: relative; height: 40px; }
.hfs-wire { position: absolute; left: -4px; right: -4px; top: 10px; width: calc(100% + 8px); height: 20px; overflow: visible; }
.hfs-w-base { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 2; stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; }
.hfs-w-live { fill: none; stroke: #f7861e; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px rgba(247,134,30,.9)); transition: stroke-dashoffset .7s ease-out; }
.hfs-pk { fill: #ffd8a8; opacity: 0; }
.hfs.s2 .w1 .hfs-w-live, .hfs.s3 .w2 .hfs-w-live { stroke-dashoffset: 0; }
.hfs.s2 .w1 .hfs-pk, .hfs.s3 .w2 .hfs-pk { opacity: 1; animation: hfsPk 1.2s linear infinite; }
.hfs .hfs-pk.p2 { animation-delay: .6s; }
@keyframes hfsPk { from { transform: translateX(2px); } to { transform: translateX(96px); } }
.hfs-via { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, 6px); padding: 4px 9px; border-radius: 99px; background: #f7861e; color: #fff; font: 700 11px Inter, sans-serif; white-space: nowrap; opacity: 0; transition: opacity .35s, transform .45s cubic-bezier(.16,1,.3,1); box-shadow: 0 8px 18px -8px rgba(247,134,30,.9); }
.hfs.s2 .hfs-via { opacity: 1; transform: translate(-50%, -2px); }

.hfs-gw img { width: 78px; height: auto; filter: brightness(.75) drop-shadow(0 12px 14px rgba(0,0,0,.5)); transition: filter .4s; }
.hfs.s2 .hfs-gw img { filter: brightness(1) drop-shadow(0 12px 14px rgba(0,0,0,.5)) drop-shadow(0 0 10px rgba(247,134,30,.35)); }
.hfs-led { position: absolute; top: 14px; right: 18%; width: 7px; height: 7px; border-radius: 50%; background: #3a4552; }
.hfs.s2 .hfs-led { background: #f7861e; box-shadow: 0 0 8px #f7861e; animation: hfsBlink .5s steps(2) infinite; }
@keyframes hfsBlink { 50% { opacity: .3; } }

.hfs-phone { position: relative; justify-self: center; width: 132px; height: 230px; padding: 26px 10px 10px; border-radius: 22px; background: #05070a; border: 1px solid #2c343e; box-shadow: 0 20px 40px -18px rgba(0,0,0,.9), inset 0 0 0 2px #10151b; display: flex; flex-direction: column; gap: 6px; transform: translateY(10px); opacity: .55; transition: transform .6s cubic-bezier(.16,1,.3,1), opacity .4s; }
.hfs.s3 .hfs-phone { transform: none; opacity: 1; }
.hfs-notch { position: absolute; top: 9px; left: 50%; width: 36px; height: 9px; margin-left: -18px; border-radius: 6px; background: #1a2028; }
.hfs-phone p { margin: 0; }
.hfs-ph-h { display: flex; justify-content: space-between; align-items: center; font: 700 9.5px Inter, sans-serif; color: #ffb066; }
.hfs-live { display: inline-flex; align-items: center; gap: 4px; color: #3fd28a; }
.hfs-live i { width: 5px; height: 5px; border-radius: 50%; background: #22b26b; box-shadow: 0 0 6px #22b26b; animation: hfsBlink 1.2s steps(2) infinite; }
.hfs-ph-name { font: 800 14px Inter, sans-serif; color: #fff; }
.hfs-pill { align-self: flex-start; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.08); color: #9fb1c4; font: 700 10.5px Inter, sans-serif; transition: background .3s, color .3s; }
.hfs.s4 .hfs-pill { background: rgba(34,178,107,.2); color: #3fd28a; }
.hfs-bars { display: flex; align-items: flex-end; gap: 4px; height: 52px; padding: 6px 4px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.hfs-bars i { flex: 1; height: 8%; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #ffb45c, #f7861e); transition: height .7s cubic-bezier(.16,1,.3,1); }
.hfs.s4 .hfs-bars i { height: var(--h); }
.hfs.s4 .hfs-bars i:nth-child(2) { transition-delay: .06s; } .hfs.s4 .hfs-bars i:nth-child(3) { transition-delay: .12s; } .hfs.s4 .hfs-bars i:nth-child(4) { transition-delay: .18s; } .hfs.s4 .hfs-bars i:nth-child(5) { transition-delay: .24s; } .hfs.s4 .hfs-bars i:nth-child(6) { transition-delay: .3s; }
.hfs-ph-k { display: flex; justify-content: space-between; font: 500 10.5px Inter, sans-serif; color: #9fb1c4; }
.hfs-ph-k b { color: #fff; font-variant-numeric: tabular-nums; }

.hfs-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: s; }
.hfs-steps li { counter-increment: s; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.04); font: 600 12.5px Inter, sans-serif; color: #7f93a8; transition: background .3s, color .3s; }
.hfs-steps li::before { content: counter(s); display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 11px; font-weight: 800; transition: background .3s, color .3s; }
.hfs.s1 .hfs-steps li:nth-child(1), .hfs.s2 .hfs-steps li:nth-child(2), .hfs.s3 .hfs-steps li:nth-child(3) { background: rgba(247,134,30,.12); color: #fff; }
.hfs.s1 .hfs-steps li:nth-child(1)::before, .hfs.s2 .hfs-steps li:nth-child(2)::before, .hfs.s3 .hfs-steps li:nth-child(3)::before { background: #f7861e; color: #fff; }

.hfs-ans { min-height: 72px; margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.06); font-size: 15px; line-height: 1.55; color: #e8eef5; transition: opacity .3s; }
.hfs-ans b { color: #3fd28a; }
.hfs-ans.swap { opacity: 0; }
.hfs-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.hfs-foot a { color: #ffb066; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.hfs-pp { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 11px; cursor: pointer; }
.hfs-pp:hover, .hfs-pp:focus-visible { background: rgba(255,255,255,.2); outline: none; }

@media (max-width: 700px) {
  .hfs { padding: 14px 12px; }
  .hfs-tabs { grid-template-columns: repeat(2, 1fr); }
  .hfs-stage { grid-template-columns: 1.2fr .5fr .7fr .4fr 1fr; min-height: 200px; padding: 22px 6px 8px; }
  .hfs-mframe { height: 100px; } .hfs-mimg { max-height: 100px; } .hfs-m.photo .hfs-mimg { max-height: 92px; }
  .hfs-gw img { width: 52px; }
  .hfs-phone { width: 96px; height: 172px; padding: 22px 7px 8px; border-radius: 18px; gap: 4px; }
  .hfs-ph-name { font-size: 12px; } .hfs-bars { height: 36px; }
  .hfs-via { font-size: 9.5px; padding: 3px 7px; }
  .hfs figcaption { font-size: 10.5px; }
  .hfs-steps li { font-size: 11px; padding: 6px 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .hfs *, .hfs *::before { transition: none !important; animation: none !important; }
}

/* the column rule ".hfit-in > div > p" (grey, 18px, half width) must not reach the story card */
.hfit-in .hfs .hfs-ans { max-width: none; margin: 12px 0 0; font-size: 15px; color: #e8eef5; }
.hfit-in .hfs .hfs-ph-h, .hfit-in .hfs .hfs-ph-name, .hfit-in .hfs .hfs-ph-k { margin: 0; max-width: none; }
.hfit-in .hfs .hfs-ph-name { font-size: 14px; color: #fff; }
.hfit-in .hfs .hfs-ph-h { font-size: 9.5px; color: #ffb066; } .hfit-in .hfs .hfs-ph-k { font-size: 10.5px; color: #9fb1c4; }
@media (max-width: 700px) { .hfit-in .hfs .hfs-ph-name { font-size: 12px; } }
