/* Animations for /blog/future-of-ai-at-work, driven by future-of-ai-at-work.js. Builds on blog-anim.css
   (.ax cards, .tok, .ch chat, .gear) and scenes.css colour tokens. Every class here starts with "fu-". */

/* hook · AI used vs work done */
.fu-pz { max-width: 460px; margin: 0 auto; }
.fu-pz-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 12px; font: 700 13px var(--body); }
.fu-pz-key span { display: inline-flex; align-items: center; gap: 6px; }
.fu-pz-key i { width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 4px; }
.fu-pz-key i.ai, .fu-pz-bars i.ai { background: var(--agent); }
.fu-pz-key i.wk, .fu-pz-bars i.wk { background: var(--ink); }
.fu-pz-chart { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.fu-pz-chart::before { content: ""; position: absolute; left: 0; right: 0; top: 130px; border-top: 2.5px solid var(--ink); }
.fu-pz-col { display: grid; grid-template-rows: 130px auto; min-width: 0; }
.fu-pz-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.fu-pz-bars i { width: min(15px, 38%); height: 0; border-radius: 4px 4px 0 0; box-shadow: inset 0 0 0 2px var(--ink); transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.fu-pz-col b { padding-top: 7px; text-align: center; font: 700 12px var(--body); color: var(--grey); }
.fu-pz-q { margin-top: 14px; text-align: center; font: 700 17px/1.3 var(--display); transition: opacity .3s, transform .35s cubic-bezier(.2, .9, .3, 1.4); }
.fu-pz-q b { padding: 0 6px; border-radius: 6px; background: var(--res); }
.fu-pz-q.pre { opacity: 0; transform: translateY(8px) scale(.94); }

/* 1 · hand loom vs power loom */
.fu-lm { display: grid; gap: 12px; }
.fu-lm-lane { border: 2.5px solid var(--ink); border-radius: 14px; background: var(--card); padding: 10px 12px; min-width: 0; transition: box-shadow .3s; }
.fu-lm-lane.on { box-shadow: 4px 4px 0 var(--agent); }
.fu-lm-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.fu-lm-h .lab { margin: 0; }
.fu-lm-n { font: 700 13px var(--body); color: var(--grey); font-variant-numeric: tabular-nums; }
.fu-lm-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 7px; min-height: 44px; }
.fu-sw { flex: none; width: 30px; height: 40px; border: 2px solid var(--ink); border-radius: 4px; background: repeating-linear-gradient(0deg, var(--a) 0 var(--w), var(--b) var(--w) calc(var(--w) * 2)); transform: rotate(var(--r, 0deg)); transition: opacity .3s, transform .35s cubic-bezier(.2, .9, .3, 1.4); }
.fu-sw.pre { opacity: 0; transform: translateY(8px) scale(.7) rotate(var(--r, 0deg)); }
.fu-sw.same { width: 24px; height: 32px; }
.fu-sw.fine { position: relative; display: flex; align-items: flex-end; width: 66px; height: 44px; overflow: hidden; background: radial-gradient(circle, #E8C25A 0 2px, transparent 2.5px) 0 0 / 9px 9px, #8E1B3A; box-shadow: 3px 3px 0 var(--ink); }
.fu-sw.fine em { display: block; width: 100%; padding: 1px 0; background: #D4A72C; border-top: 2px solid var(--ink); font: 800 10px/1.4 var(--body); font-style: normal; text-align: center; color: var(--ink); }

/* 2 · the floor rises */
.fu-fl { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 150px; max-width: 460px; margin: 28px auto 0; border-bottom: 2.5px solid var(--ink); }
.fu-fl-bar { position: relative; flex: 1; min-width: 0; height: 0; border: 2px solid var(--ink); border-bottom: 0; border-radius: 5px 5px 0 0; transition: height .7s cubic-bezier(.2, .8, .2, 1), background-color .5s, box-shadow .3s; }
.fu-fl-bar.c0 { background: #E3F3FB; } .fu-fl-bar.c1 { background: #FFF1BF; } .fu-fl-bar.c2 { background: #E2F3E7; } .fu-fl-bar.c3 { background: #FBE6E2; }
.fu-fl.same .fu-fl-bar { background: #F1F0EA; }
.fu-fl.same .fu-fl-bar.edge { background: var(--agent); box-shadow: 3px 0 0 var(--ink); }
.fu-fl-line { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; border-top: 2.5px dashed var(--ink); pointer-events: none; transition: bottom .8s cubic-bezier(.2, .8, .2, 1); }
.fu-fl-line span { position: absolute; left: 4px; bottom: 4px; padding: 1px 7px; border-radius: 6px; background: var(--ink); color: var(--paper); font: 800 10.5px/1.5 var(--body); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; transition: background-color .4s, color .4s; }
.fu-fl-line.up span { background: var(--agent); color: var(--ink); }
.fu-fl-tag { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); padding: 1px 7px; border: 2px solid var(--ink); border-radius: 6px; background: var(--res); font: 800 11.5px/1.3 var(--body); font-style: normal; white-space: nowrap; transition: opacity .3s, transform .3s; }
.fu-fl-tag.pre { opacity: 0; transform: translate(-50%, 6px); }

/* 3 · the birthday message */
.fu-ed { min-height: 0; }
.fu-ed .bb { font-size: 14px; }
.fu-ed-others { justify-self: start; max-width: 92%; display: grid; gap: 4px; padding: 8px 10px; border: 2px dashed #B5B3AA; border-radius: 12px; transition: opacity .4s, transform .3s; }
.fu-ed-others .lab { margin-bottom: 2px; }
.fu-ed-others p { margin: 0; font: 500 13px/1.4 var(--body); color: var(--grey); transition: opacity .3s, transform .3s; }
.fu-ed-others.dim { opacity: .45; }
.fu-ed-mine { justify-self: end; max-width: 92%; padding: 8px 10px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--card); box-shadow: 4px 4px 0 var(--agent); transition: opacity .3s, transform .3s; }
.fu-ed-mine .lab { margin-bottom: 6px; }
.fu-ed-mine .toks { gap: 5px 4px; }
.fu-ed-mine .tok { font-size: 13.5px; padding: 1px 6px; }
.fu-ed-others.pre, .fu-ed-others p.pre, .fu-ed-mine.pre { opacity: 0; transform: translateY(8px); }

/* 4 · the jagged frontier */
.fu-jg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fu-jg-card { min-width: 0; padding: 10px 12px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--card); opacity: .4; transition: opacity .35s, box-shadow .3s; }
.fu-jg-card.on { opacity: 1; box-shadow: 4px 4px 0 var(--agent); }
.fu-jg-card .lab { margin-bottom: 4px; }
.fu-jg-t { display: block; font: 700 14.5px/1.35 var(--body); }
.fu-jg-rows { display: grid; gap: 7px; min-height: 58px; margin-top: 10px; align-content: start; }
.fu-jg-r { display: grid; grid-template-columns: 52px minmax(0, 1fr) 56px; gap: 8px; align-items: center; font: 600 13.5px var(--body); transition: opacity .3s, transform .3s; }
.fu-jg-r.pre { opacity: 0; transform: translateY(6px); }
.fu-jg-bw { height: 16px; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; background: var(--paper); }
.fu-jg-bw i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.fu-jg-r.ai .fu-jg-bw i { background: var(--agent); }
.fu-jg-r.bad .fu-jg-bw i { background: #EE9B8A; }
.fu-jg-r .v { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) { .fu-jg { grid-template-columns: minmax(0, 1fr); } }

/* 5 · units and tokens */
.fu-mt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fu-mt-box { min-width: 0; padding: 10px 12px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--card); transition: box-shadow .3s; }
.fu-mt-box.on { box-shadow: 4px 4px 0 var(--agent); }
.fu-mt-disp { padding: 8px 12px; border-radius: 10px; background: var(--ink); color: var(--paper); font: 700 19px/1.25 var(--mono); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fu-mt-list { display: grid; gap: 5px; min-height: 92px; margin-top: 8px; align-content: start; }
.fu-mt-item { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 3px 8px; border-radius: 6px; background: #F1F0EA; font: 600 13px/1.35 var(--body); transition: opacity .3s, transform .3s; }
.fu-mt-item span { min-width: 0; overflow-wrap: anywhere; }
.fu-mt-item b { flex: none; font: 700 12.5px var(--mono); }
.fu-mt-item.pre { opacity: 0; transform: translateY(6px); }
@media (max-width: 640px) { .fu-mt { grid-template-columns: minmax(0, 1fr); } .fu-mt-list { min-height: 0; } }

/* 6 · the factory */
.fu-fc { max-width: 480px; margin: 0 auto; }
.fu-fc-hall { position: relative; padding: 46px 10px 12px; border: 2.5px solid var(--ink); border-top-width: 7px; border-radius: 6px 6px 12px 12px; background: var(--card); transition: background-color .7s; }
.fu-fc.lit .fu-fc-hall { background: linear-gradient(#FFF6CC, var(--card) 70%); }
.fu-fc-roof { position: absolute; top: -7px; left: 14px; right: 14px; display: flex; justify-content: space-around; pointer-events: none; }
.fu-fc-sky { width: 22%; height: 7px; background: var(--res); opacity: 0; transition: opacity .6s; }
.fu-fc.lit .fu-fc-sky { opacity: 1; }
.fu-fc-shaft { position: absolute; top: 12px; left: 10px; right: 10px; height: 10px; border: 2px solid var(--ink); border-radius: 5px; background: repeating-linear-gradient(90deg, var(--ink) 0 5px, #F1F0EA 5px 14px); transition: opacity .6s; }
.fu-fc.run .fu-fc-shaft { animation: fu-shaft .5s linear infinite; }
.fu-fc.unit .fu-fc-shaft { opacity: 0; animation: none; }
@keyframes fu-shaft { to { background-position: 14px 0; } }
.fu-fc-floor { --g: 8px; display: grid; grid-template-columns: 66px repeat(4, minmax(0, 1fr)); gap: var(--g); align-items: end; transition: grid-template-columns .6s; }
.fu-fc.unit .fu-fc-floor { grid-template-columns: 0px repeat(4, minmax(0, 1fr)); }
.fu-fc.lit .fu-fc-floor { --g: 16px; }
.fu-fc-pow, .fu-fc-m { position: relative; height: 56px; min-width: 0; border: 2.5px solid var(--ink); border-radius: 9px; }
.fu-fc-pow::before, .fu-fc-m::before { content: ""; position: absolute; bottom: 100%; left: 50%; height: 24px; border-left: 2.5px dashed var(--ink); transition: opacity .5s; }
.fu-fc-pow { display: grid; place-items: center; padding: 3px; background: #F1F0EA; text-align: center; transition: opacity .4s, transform .35s, background-color .4s; }
.fu-fc-pow b { font: 800 11px/1.2 var(--body); overflow-wrap: anywhere; }
.fu-fc-pow.elec { background: var(--agent); }
.fu-fc-pow.pre { opacity: 0; transform: scale(.9); }
.fu-fc.unit .fu-fc-pow { overflow: hidden; opacity: 0; visibility: hidden; transition: opacity .4s, visibility 0s .4s; }
.fu-fc-m { display: grid; place-items: center; background: var(--card); }
.fu-fc-m .gear { width: 16px; height: 16px; animation: none; }
.fu-fc.run .fu-fc-m .gear { animation: ax-spin 1.4s linear infinite; }
.fu-fc.unit .fu-fc-m::before { opacity: 0; }
.fu-fc-m:not(:last-child)::after { content: "→"; position: absolute; top: 50%; right: calc(var(--g) / -2); transform: translate(50%, -50%); font: 800 13px var(--body); opacity: 0; transition: opacity .4s; }
.fu-fc.lit .fu-fc-m:not(:last-child)::after { opacity: 1; }
.fu-fc-mot { position: absolute; right: 3px; bottom: 3px; width: 13px; height: 13px; border: 2px solid var(--ink); border-radius: 50%; background: var(--agent); transition: opacity .3s, transform .35s cubic-bezier(.2, .9, .3, 1.4); }
.fu-fc-mot.pre { opacity: 0; transform: scale(.3); }
.fu-fc-out { display: grid; grid-template-columns: auto minmax(0, 1fr) 86px; gap: 10px; align-items: center; margin-top: 12px; }
.fu-fc-out .lab { margin: 0; }
.fu-fc-ob { height: 18px; border: 2.5px solid var(--ink); border-radius: 6px; overflow: hidden; background: var(--paper); }
.fu-fc-ob i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .9s cubic-bezier(.2, .8, .2, 1), background-color .4s; }
.fu-fc.lit .fu-fc-ob i { background: var(--agent); }
.fu-fc-out b { font: 700 13px/1.25 var(--body); }

/* 7 · Mum is the wire → the agent is wired in */
.fu-wr { max-width: 480px; margin: 0 auto; }
.fu-wr-apps { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; padding: 7px; border: 2.5px dashed transparent; border-radius: 14px; transition: border-color .4s, background-color .4s; }
.fu-wr-app { padding: 4px 10px; border: 2.5px solid var(--ink); border-radius: 10px; background: var(--card); font: 700 13px/1.3 var(--body); white-space: nowrap; transition: background-color .3s, box-shadow .3s; }
.fu-wr-app.hot { background: var(--agent); box-shadow: 3px 3px 0 var(--ink); }
.fu-wr.wired .fu-wr-apps { border-color: var(--agent); background: rgba(88, 186, 235, .08); }
.fu-wr.wired .fu-wr-apps::after { content: ""; position: absolute; top: 100%; left: 50%; height: 16px; border-left: 3px solid var(--agent); }
.fu-wr.wired .fu-wr-app.chat { display: none; }
.fu-wr-mid { margin-top: 16px; }
.fu-wr-jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.fu-wr-jobs li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 7px; background: #F1F0EA; font: 600 13.5px/1.35 var(--body); transition: opacity .3s, transform .3s; }
.fu-wr-jobs li.pre { opacity: 0; transform: translateY(6px); }
.fu-wr-who { flex: none; padding: 1px 7px; border-radius: 6px; background: var(--ink); color: var(--paper); font: 800 11px/1.5 var(--body); }
.fu-wr-agent { padding: 10px 12px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--card); box-shadow: 4px 4px 0 var(--agent); text-align: center; transition: opacity .3s, transform .3s; }
.fu-wr-agent.pre { opacity: 0; transform: translateY(8px) scale(.96); }
.fu-wr-agent > b { font: 800 15px var(--body); }
.fu-wr-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.fu-wr-tag { padding: 2px 9px; border: 2px solid var(--ink); border-radius: 999px; background: var(--toolT); font: 700 12.5px/1.4 var(--body); transition: opacity .3s, transform .3s; }
.fu-wr-tag.pre { opacity: 0; transform: translateY(6px) scale(.9); }
.fu-wr-flow { justify-content: center; margin-top: 14px; }
.fu-wr-flow .tok { font: 600 13px/1.3 var(--body); padding: 2px 8px; }
.fu-wr-arr { font: 800 14px var(--body); transition: opacity .3s; }
.fu-wr-arr.pre { opacity: 0; }

/* phones: reserve each scene's tallest frame up front (measured at a 300px stage), so the text below doesn't move */
@media (max-width: 640px) {
  .ax[data-anim=fu-puzzle] .ax-stage { min-height: 258px; } .ax[data-anim=fu-loom] .ax-stage { min-height: 280px; }
  .ax[data-anim=fu-floor] .ax-stage { min-height: 222px; } .ax[data-anim=fu-edge] .ax-stage { min-height: 480px; }
  .ax[data-anim=fu-jagged] .ax-stage { min-height: 345px; } .ax[data-anim=fu-meter] .ax-stage { min-height: 415px; }
  .ax[data-anim=fu-factory] .ax-stage { min-height: 245px; } .ax[data-anim=fu-wiring] .ax-stage { min-height: 375px; }
}
