/* BizAuto · FX v3.4 – intro, spotlight cards, word reveal, scroll progress, gauge. */

/* ---------- particle intro ---------- */
#ba-intro { position: fixed; inset: 0; z-index: 9999; background: radial-gradient(ellipse at 50% 40%, #13235c 0%, #070b1f 70%); display: block;
  transition: opacity .7s cubic-bezier(.2, .8, .2, 1), transform .9s cubic-bezier(.2, .8, .2, 1), visibility .7s; }
#ba-intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#ba-intro.done { opacity: 0; visibility: hidden; transform: scale(1.08); pointer-events: none; }
#ba-intro .skip { position: absolute; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom)); padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .75); font: 600 .72rem 'Plus Jakarta Sans', sans-serif; letter-spacing: .16em; text-transform: uppercase; }
#ba-intro .skip:hover { background: rgba(255, 255, 255, .14); color: #fff; }
#ba-intro .ba-tagline { position: absolute; left: 0; right: 0; top: calc(50% + 92px); text-align: center; color: rgba(255, 255, 255, .7); font: 500 .9rem 'Plus Jakarta Sans', sans-serif; letter-spacing: .28em; text-transform: uppercase; opacity: 0; animation: fx-tag .8s ease 1.3s forwards; }
@keyframes fx-tag { to { opacity: 1; letter-spacing: .34em; } }
html.ba-intro-on { overflow: hidden; }

/* ---------- scroll progress ---------- */
.fx-progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 80; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #22d3ee, #6366f1, #ec4899, #f59e0b); box-shadow: 0 0 12px rgba(99, 102, 241, .6); pointer-events: none; }

/* ---------- heading word reveal ---------- */
.fx-words .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.fx-words .w > span { display: inline-block; transform: translateY(105%) rotate(4deg); opacity: 0; animation: fx-word .7s cubic-bezier(.2, .9, .2, 1) forwards; animation-delay: calc(var(--i) * 70ms + 120ms); }
@keyframes fx-word { to { transform: none; opacity: 1; } }
/* page title stays plain text (gradient + word reveal clipped it on phones) */
@keyframes fx-titleflow { 50% { background-position: 100% 0; } }

/* ---------- spotlight + lift on cards ---------- */
.card, .stat { --mx: 50%; --my: 0%; }
@media (hover: hover) {
  .card { transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s; }
  .card:hover { transform: translateY(-3px); box-shadow: 0 22px 48px rgba(30, 58, 138, .14), 0 2px 6px rgba(30, 58, 138, .06); }
  .card::after, .stat::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
    background: radial-gradient(420px circle at var(--mx) var(--my), rgba(99, 102, 241, .10), transparent 45%); }
  .card:hover::after, .stat:hover::after { opacity: 1; }
}
.card { position: relative; }

/* sidebar items wave in on first paint */
.sidebar nav > a { animation: fx-navin .55s cubic-bezier(.2, .9, .2, 1) both; animation-delay: calc(var(--n, 0) * 35ms); }
@keyframes fx-navin { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.sidebar nav > a:hover .ic { transform: scale(1.15) rotate(-6deg); }
.brand .ba-tile { animation: fx-float 5s ease-in-out infinite; display: inline-flex; }
@keyframes fx-float { 50% { transform: translateY(-3px) rotate(-3deg); } }

/* pills / alerts / tables */
.pill { animation: fx-pop .5s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes fx-pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
table tr { animation: fx-row .5s ease both; }
table tr:nth-child(2) { animation-delay: .04s; } table tr:nth-child(3) { animation-delay: .08s; } table tr:nth-child(4) { animation-delay: .12s; }
table tr:nth-child(5) { animation-delay: .16s; } table tr:nth-child(6) { animation-delay: .2s; } table tr:nth-child(n+7) { animation-delay: .24s; }
@keyframes fx-row { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.btn:not(.small):hover { transform: translateY(-1px); }
.btn.primary { background-size: 200% 100%; }
.empty h3::before { content: "✨"; display: block; font-size: 2rem; margin-bottom: 6px; animation: fx-float 3s ease-in-out infinite; }

/* ---------- score gauge ---------- */
.gauge { position: relative; width: 260px; max-width: 100%; flex: 0 0 auto; }
.gauge svg { width: 100%; height: auto; display: block; overflow: visible; }
.gauge .g-track { fill: none; stroke: rgba(15, 23, 42, .08); stroke-width: 18; stroke-linecap: round; }
.gauge .g-arc, .gauge .g-glow { fill: none; stroke-width: 18; stroke-linecap: round; stroke-dashoffset: 314.16; animation: fx-arc 1.8s cubic-bezier(.2, .8, .2, 1) .25s forwards; }
.gauge .g-glow { opacity: .55; stroke-width: 22; }
@keyframes fx-arc { to { stroke-dashoffset: var(--off); } }
.gauge .tk { stroke: rgba(15, 23, 42, .25); stroke-width: 1.5; stroke-linecap: round; }
.gauge .tk.big { stroke: rgba(15, 23, 42, .45); stroke-width: 2.4; }
.gauge .g-lbl { font: 600 11px 'Plus Jakarta Sans', sans-serif; fill: #64748b; }
.gauge .g-needle { transform-origin: 120px 130px; transform: rotate(-90deg); animation: fx-needle 2s cubic-bezier(.3, 1.35, .45, 1) .25s forwards; }
.gauge .g-needle path { fill: #0f172a; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.gauge .g-needle circle { fill: #0f172a; }
.gauge .g-needle .g-hub { fill: #fff; }
@keyframes fx-needle { to { transform: rotate(var(--deg)); } }
.gauge .g-num { position: absolute; left: 0; right: 0; bottom: -6px; text-align: center; line-height: 1.05; }
.gauge .g-num b { display: block; font: 800 2.6rem 'Outfit', 'Plus Jakarta Sans', sans-serif; letter-spacing: -.03em;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gauge .g-num small { display: block; color: #64748b; font-size: .78rem; font-weight: 600; }
.gauge .g-pill { display: inline-block; margin-top: 6px; padding: 3px 12px; border-radius: 999px; font-size: .74rem; font-weight: 800; letter-spacing: .04em; color: #fff;
  background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 6px 14px rgba(16, 185, 129, .35); opacity: 0; animation: fx-pop .6s cubic-bezier(.3, 1.5, .5, 1) 1.6s forwards; }
.gauge[data-gauge] .g-pill { background: linear-gradient(135deg, hsl(calc(var(--score) * 1.4) 80% 45%), hsl(calc(var(--score) * 1.4 - 15) 85% 38%)); }
.gauge-wrap { display: flex; gap: 30px; align-items: center; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  .fx-words .w > span, .sidebar nav > a, .pill, table tr, .gauge *, .brand .ba-tile, .topbar h1 { animation: none !important; transform: none !important; opacity: 1 !important; }
  .gauge .g-arc, .gauge .g-glow { stroke-dashoffset: var(--off) !important; }
  .gauge .g-needle { transform: rotate(var(--deg)) !important; }
}

/* ---------- Title Case for every UI label (each word starts with a capital) ---------- */
h1, h2, h3, h4, .topbar h1, .sidebar nav a span, .btn, .tabs a, .stat .label, th, .pill, .ui-seg a, .tabbar span, .card-head h3, legend, .option-grid label, .kw-list li > span:first-child, .check b, .banner a { text-transform: capitalize; }
.fx-words .w > span { text-transform: capitalize; }

/* ---------- live form validation ---------- */
.form input.fx-bad, .form select.fx-bad, .form textarea.fx-bad, input.fx-bad { border-color: #ef4444 !important; box-shadow: 0 0 0 4px rgba(239, 68, 68, .14) !important; animation: fx-shake .35s ease; }
.form input.fx-good:not([type=checkbox]):not([type=radio]) { border-color: #10b981 !important; }
.fx-err { display: block; color: #dc2626; font-size: .78rem; font-weight: 600; margin-top: 4px; animation: fx-fade .25s ease both; }
@keyframes fx-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@keyframes fx-fade { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
/* number sits under the dial so the needle never covers it */
.gauge .g-num { position: static; margin-top: 4px; }
.gauge .g-num b { font-size: 2.4rem; }
