/* AGENT FX — the crew bar above the thread and the effects on the preview stage. One easing, three
   durations, transform/opacity only; reduced-motion keeps the states and drops the motion. */
:root { --fx-ease: cubic-bezier(.2,.8,.2,1); --fx-fast: .18s; --fx-mid: .32s; --fx-slow: .6s; }

/* ── the crew bar ── */
.fx-crew { --c: #FFD731; position: relative; margin: 0 12px; max-height: 0; opacity: 0; overflow: hidden; transform: translateY(-6px);
  transition: max-height var(--fx-mid) var(--fx-ease), opacity var(--fx-mid) var(--fx-ease), transform var(--fx-mid) var(--fx-ease), margin var(--fx-mid) var(--fx-ease); }
.fx-crew.on { max-height: 120px; opacity: 1; transform: none; margin: 10px 12px 2px; }
.fx-crew { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 10px; }
.fx-crew::before { content: ""; position: absolute; inset: -1px; border-radius: 16px; padding: 1px; background: linear-gradient(90deg, transparent, var(--c), transparent) 0 0 / 200% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; animation: fx-sweep 2.6s linear infinite; pointer-events: none; }
.fx-crew.finished::before { animation: none; opacity: 0; transition: opacity .6s; }
@keyframes fx-sweep { to { background-position: -200% 0; } }
.fx-row { position: relative; display: flex; justify-content: space-between; z-index: 1; }
.fx-track { position: absolute; left: 30px; right: 30px; top: 30px; height: 1px; background: linear-gradient(90deg, transparent, var(--line) 8%, var(--line) 92%, transparent); }
.fx-beam { position: absolute; left: -30px; top: -3px; width: 26px; height: 7px; border-radius: 99px; background: radial-gradient(closest-side, var(--c), transparent); filter: blur(1px); opacity: 0; }
.fx-agent { --c: #FFD731; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 54px; opacity: .45; transition: opacity var(--fx-mid) var(--fx-ease); }
.fx-agent.skip { opacity: .16; }
.fx-agent.on, .fx-agent.done { opacity: 1; }
.fx-orb { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: var(--card); border: 1px solid var(--line);
  transition: transform var(--fx-mid) var(--fx-ease), color var(--fx-mid), border-color var(--fx-mid), box-shadow var(--fx-mid); }
.fx-orb svg { width: 18px; height: 18px; }
.fx-agent.on .fx-orb { color: #111; background: var(--c); border-color: transparent; transform: scale(1.14); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 18%, transparent), 0 8px 28px color-mix(in srgb, var(--c) 45%, transparent); }
.fx-agent.done .fx-orb { color: var(--c); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.fx-ring { position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid transparent; border-top-color: var(--c); border-right-color: color-mix(in srgb, var(--c) 40%, transparent); opacity: 0; }
.fx-agent.on .fx-ring { opacity: 1; animation: fx-spin 1.1s linear infinite; }
@keyframes fx-spin { to { transform: rotate(360deg); } }
.fx-tick { position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; background: var(--c); color: #111; font: 700 9px/15px var(--sans, system-ui); text-align: center; transform: scale(0); transition: transform var(--fx-mid) var(--fx-ease); }
.fx-agent.done .fx-tick { transform: scale(1); }
.fx-name { font-size: 10.5px; letter-spacing: .02em; color: var(--muted); }
.fx-agent.on .fx-name { color: var(--ink); font-weight: 600; }
.fx-now { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 12px; color: var(--muted); min-height: 16px; }
.fx-now .fx-line { color: var(--ink); }
.fx-dots { display: inline-flex; gap: 3px; }
.fx-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--c); animation: fx-bob 1s var(--fx-ease) infinite; }
.fx-dots i:nth-child(2) { animation-delay: .15s; } .fx-dots i:nth-child(3) { animation-delay: .3s; }
.fx-crew.finished .fx-dots { display: none; }
@keyframes fx-bob { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-3px); opacity: 1; } }

/* ── the stage ── */
.stage { --fx: #FFD731; }
.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.fx-aura { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: 0; z-index: 7;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--fx) 70%, transparent), inset 0 0 40px color-mix(in srgb, var(--fx) 22%, transparent); transition: opacity var(--fx-slow) var(--fx-ease); }
.stage.fx-on .fx-aura { opacity: 1; animation: fx-breathe 2.4s ease-in-out infinite; }
.stage.fx-on .frame:not(.full) { box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px #2a2a30, 0 0 0 8px #141418, 0 0 60px -6px color-mix(in srgb, var(--fx) 55%, transparent); transition: box-shadow var(--fx-slow) var(--fx-ease); }
.stage.fx-fail { --fx: #FF8A4C; }
.stage.fx-done .fx-aura { opacity: 1; --fx: #3FD68A; animation: fx-flash 1.6s var(--fx-ease) 1 forwards; }
@keyframes fx-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes fx-flash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
/* the reviewer's scan beam, clipped to the screen */
.fx-scan { position: absolute; left: 0; right: 0; top: 0; height: 22%; pointer-events: none; z-index: 8; opacity: 0;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, #B18CFF 16%, transparent) 70%, color-mix(in srgb, #B18CFF 70%, transparent) 99%, transparent);
  transform: translateY(-110%); }
.fx-scan.on { opacity: 1; animation: fx-scan 1.8s cubic-bezier(.45,.05,.55,.95) infinite; }
@keyframes fx-scan { 0% { transform: translateY(-110%); } 100% { transform: translateY(480%); } }
/* the files being written */
.fx-ribbons { position: absolute; left: 16px; bottom: 44px; display: flex; flex-direction: column-reverse; gap: 6px; max-width: min(340px, 46%); transition: opacity .6s; }
.fx-ribbons.fade { opacity: 0; }
.fx-rib { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 10px; background: rgba(18,18,22,.86); border: 1px solid #2a2a31; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font: 12px/1.3 var(--mono, ui-monospace, monospace); color: #e8e4da; box-shadow: 0 10px 30px rgba(0,0,0,.35); transform: translateX(-14px); opacity: 0;
  transition: transform var(--fx-mid) var(--fx-ease), opacity var(--fx-mid) var(--fx-ease); }
.fx-rib.in { transform: none; opacity: 1; }
.fx-rib i { width: 7px; height: 7px; border-radius: 50%; background: #FFD731; box-shadow: 0 0 10px #FFD731; flex: none; }
.fx-rib .p { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-rib em { font-style: normal; font-size: 10.5px; color: #8d8a82; }
.fx-rib.again em::before { content: "re"; }
.fx-rib:nth-child(n+2) { opacity: .7; } .fx-rib:nth-child(n+4) { opacity: .4; }
/* the checks */
.fx-checks { position: absolute; left: 16px; top: 58px; display: flex; flex-wrap: wrap; gap: 6px; max-width: 46%; }
.fx-chk { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 8px; border-radius: 999px; background: rgba(18,18,22,.86); border: 1px solid #2a2a31; font-size: 11.5px; color: #e8e4da;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transform: translateY(-6px) scale(.96); opacity: 0; transition: transform var(--fx-mid) var(--fx-ease), opacity var(--fx-mid) var(--fx-ease); }
.fx-chk.in { transform: none; opacity: 1; }
.fx-chk i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #6f6c66; position: relative; flex: none; }
.fx-chk.run i { border-color: #4FD1C5; border-top-color: transparent; animation: fx-spin .8s linear infinite; }
.fx-chk.ok i { border-color: #3FD68A; background: #3FD68A; }
.fx-chk.ok i::after { content: ""; position: absolute; left: 3px; top: 1px; width: 3px; height: 6px; border: solid #0c2a18; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.fx-chk.bad i { border-color: #FF8A4C; background: #FF8A4C; }
/* the design score */
.fx-score { position: absolute; right: 18px; top: 58px; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(18,18,22,.9); border: 1px solid #2a2a31;
  color: #f3efe6; transform: translateY(-8px) scale(.9); opacity: 0; transition: transform var(--fx-slow) cubic-bezier(.3,1.6,.5,1), opacity var(--fx-mid) var(--fx-ease); }
.fx-score.in { transform: none; opacity: 1; }
.fx-score svg { width: 34px; height: 34px; transform: rotate(-90deg); }
.fx-score circle { fill: none; stroke-width: 4; } .fx-score .bg { stroke: #2a2a31; }
.fx-score .fg { stroke: #B18CFF; stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 119.4; transition: stroke-dashoffset 1.1s var(--fx-ease) .15s; }
.fx-score.in .fg { stroke-dashoffset: calc(119.4 - 119.4 * var(--p) / 100); }
.fx-score b { font: 600 20px/1 var(--sans, system-ui); margin-left: -38px; width: 34px; text-align: center; }
.fx-score span { font-size: 11.5px; color: #a8a49b; margin-left: 4px; }

@media (prefers-reduced-motion: reduce) {
  .fx-crew, .fx-crew::before, .fx-agent, .fx-orb, .fx-ring, .fx-dots i, .fx-aura, .fx-scan, .fx-rib, .fx-chk, .fx-score, .fx-score .fg { animation: none !important; transition: none !important; }
  .fx-scan.on { opacity: .6; transform: translateY(160%); }
}

/* no room beside the phone: the checks ride in the crew bar and the file names in its line */
.fx-layer.narrow .fx-ribbons, .fx-layer.narrow .fx-checks { display: none; }
.fx-mini { display: none; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.fx-crew.narrow .fx-mini:not(:empty) { display: flex; }
.fx-mini .fx-chk { transform: none; opacity: 1; background: var(--card2); border-color: var(--line); color: var(--muted); font-size: 11px; padding: 3px 9px 3px 7px; }
.fx-crew.on.narrow { max-height: 160px; }
