/* ═════════════════════════ ImpactHive v2 — depth, motion and delight ═════════════════════════
   Layered on top of style.css. Everything animated here is switched off for people who ask for reduced motion. */

:root { --on-brand: #ffffff; } :root[data-theme="dark"] { --on-brand: #04201d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --on-brand: #04201d; } }

/* aurora background: two slow, blurred colour fields behind everything */
body::before, body::after { content: ""; position: fixed; z-index: -1; border-radius: 50%; filter: blur(90px); pointer-events: none; }
body::before { width: 560px; height: 560px; right: -140px; top: -170px; background: radial-gradient(circle, var(--brand-glow), transparent 66%); opacity: .42; animation: drift1 26s ease-in-out infinite alternate; }
body::after { width: 520px; height: 520px; left: 260px; bottom: -230px; background: radial-gradient(circle, #6366f1, transparent 66%); opacity: .24; animation: drift2 32s ease-in-out infinite alternate; }
:root[data-theme="dark"] body::before { opacity: .2; } :root[data-theme="dark"] body::after { opacity: .16; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { opacity: .2; } :root:not([data-theme="light"]) body::after { opacity: .16; } }
@keyframes drift1 { to { transform: translate(-120px, 140px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(160px, -120px) scale(1.2); } }

/* thin progress bar across the top while a screen loads */
#nprog { position: fixed; left: 0; top: 0; height: 3px; width: 0; z-index: 70; background: linear-gradient(90deg, var(--brand-glow), #6366f1, #f59e0b); box-shadow: 0 0 12px color-mix(in srgb, var(--brand-glow) 80%, transparent); opacity: 0; transition: width .45s cubic-bezier(.2, .8, .2, 1), opacity .3s; border-radius: 0 3px 3px 0; }

/* glass sticky page header */
main { position: relative; }
.pagehead {
  position: sticky; top: 0; z-index: 6; margin: -26px -32px 22px; padding: 22px 32px 14px; backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  background: color-mix(in srgb, var(--bg) 70%, transparent); border-bottom: 1px solid transparent; transition: border-color .25s, box-shadow .25s;
}
.pagehead.scrolled { border-bottom-color: var(--line); box-shadow: 0 12px 30px -22px rgba(18, 32, 58, .5); }
.pagehead h2 { background: linear-gradient(90deg, var(--ink) 60%, var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* entrance choreography: the view fades in, its cards rise one after another, table rows cascade */
#view { animation: fadein .3s ease both; }
#view > .card, #view > .grid > * { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 75ms); }
tbody tr.rowin { animation: rowin .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 24ms); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes rowin { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* cards that respond to the pointer */
.card { transition: box-shadow .3s, transform .3s, border-color .3s; }
.stat { transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, border-color .3s; }
.stat::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--tc, var(--brand)) 20%, transparent), transparent 62%); }
.stat:hover { transform: translateY(-5px); box-shadow: 0 24px 44px -20px color-mix(in srgb, var(--tc, var(--brand)) 55%, #12203a); border-color: color-mix(in srgb, var(--tc, var(--brand)) 40%, var(--line)); }
.stat:hover::before { opacity: 1; }
.stat .ico { transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); } .stat:hover .ico { transform: rotate(-6deg) scale(1.1); }
.stat .kpi { background: linear-gradient(180deg, var(--ink), color-mix(in srgb, var(--ink) 68%, var(--tc, var(--brand)))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .kpi.neg { background: none; color: var(--bad); }
.todo:hover .dot { animation: ping 1s infinite; } @keyframes ping { 70% { box-shadow: 0 0 0 9px transparent; } }

/* buttons: gradient, shine sweep, ripple */
button { position: relative; overflow: hidden; isolation: isolate; }
button:not(.ghost):not(.bad):not(.iconbtn):not(.tabbtn):not(.themecard) { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 94%, #fff), var(--brand)); color: var(--on-brand); }
button:not(.ghost):not(.bad):not(.iconbtn):not(.tabbtn):not(.themecard):hover:not(:disabled) { background: linear-gradient(180deg, var(--brand), var(--brand-hover)); }
button:not(.ghost):not(.bad):not(.iconbtn):not(.tabbtn):not(.themecard)::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .32) 50%, transparent 70%); transform: translateX(-130%); transition: transform .65s; }
button:hover:not(:disabled)::after { transform: translateX(130%); }
.tabs button { background: transparent !important; color: var(--mut) !important; } .tabs button::after { display: none; } .tabs button.on { background: var(--surface) !important; color: var(--brand-ink) !important; animation: tabpop .35s cubic-bezier(.3, 1.6, .5, 1); }
.ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .5); transform: scale(0); animation: ripple .65s linear; pointer-events: none; z-index: 0; }
.ghost .ripple, .tabs .ripple { background: color-mix(in srgb, var(--brand) 30%, transparent); }
@keyframes ripple { to { transform: scale(4); opacity: 0; } } @keyframes tabpop { from { transform: scale(.92); } }

/* nicer native controls */
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-repeat: no-repeat; background-position: right 10px center; background-size: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8aa5' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.orgbox select { background-repeat: no-repeat; background-position: right 2px center; background-size: 15px; padding-right: 26px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9bbd6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--line2); border-radius: 6px; background: var(--surface); display: inline-grid; place-content: center; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; flex: none; }
input[type="checkbox"]:hover { border-color: var(--brand-glow); transform: scale(1.08); }
input[type="checkbox"]:checked { background: var(--brand); border-color: var(--brand); animation: tabpop .3s cubic-bezier(.3, 1.6, .5, 1); }
input[type="checkbox"]:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--on-brand); border-bottom: 2px solid var(--on-brand); transform: rotate(-45deg) translate(1px, -1px); }
input[type="date"], input[type="month"] { cursor: pointer; }

/* navigation polish */
nav.side a.nav { transition: background .2s, color .2s, transform .2s; } nav.side a.nav:hover { transform: translateX(4px); }
nav.side a.nav svg { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); } nav.side a.nav:hover svg { transform: scale(1.18) rotate(-4deg); }
nav.side a.nav.on::before { animation: barin .4s cubic-bezier(.2, .8, .2, 1) both; transform-origin: top; } @keyframes barin { from { transform: scaleY(0); } }
nav.side a.nav.on { box-shadow: 0 8px 22px -12px color-mix(in srgb, var(--brand-glow) 80%, transparent); }
.brand .logo { animation: logoglow 4s ease-in-out infinite alternate; } @keyframes logoglow { to { box-shadow: 0 8px 30px -4px rgba(245, 158, 11, .6); } }

/* toasts with a draining timer */
.t { position: relative; overflow: hidden; }
.t::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--brand-glow), #f59e0b); transform-origin: left; animation: drain var(--dur, 4.2s) linear forwards; }
.t.error::after { background: linear-gradient(90deg, #fb7185, var(--bad)); } @keyframes drain { to { transform: scaleX(0); } }
.t svg { animation: tabpop .45s cubic-bezier(.3, 1.6, .5, 1) .1s both; }

/* celebration confetti */
.confetti { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 80; pointer-events: none; }
.confetti i { position: absolute; width: 8px; height: 13px; border-radius: 2px; background: var(--c); opacity: 0; animation: burst 1.25s cubic-bezier(.1, .75, .3, 1) forwards; animation-delay: var(--d, 0s); }
@keyframes burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); } }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; } .chart text { fill: var(--mut); font-size: 11px; font-family: inherit; }
.chart .grid-l { stroke: var(--line); stroke-dasharray: 3 5; }
.chart .bar-r { transform-box: fill-box; transform-origin: 50% 100%; animation: grow .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); transition: filter .2s; }
.chart .bar-r:hover { filter: brightness(1.15) drop-shadow(0 4px 8px rgba(18, 32, 58, .25)); } @keyframes grow { from { transform: scaleY(0); } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--mut); font-size: 12px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-center { position: relative; width: 168px; height: 168px; flex: none; } .donut-center .donut { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .track { fill: none; stroke: var(--line); stroke-width: 4.2; }
.donut .seg { fill: none; stroke-width: 4.2; stroke-dasharray: 0 100; animation: segin 1.1s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 120ms); transition: stroke-width .2s; } .donut .seg:hover { stroke-width: 5.4; }
@keyframes segin { to { stroke-dasharray: var(--len) calc(100 - var(--len)); } }
.donut-center .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; } .donut-center .mid b { font-size: 17px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .donut-center .mid span { color: var(--mut); font-size: 11px; }
.lg-list { flex: 1; min-width: 170px; display: grid; gap: 8px; } .lg-row { display: flex; align-items: center; gap: 9px; font-size: 13px; } .lg-row i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lg-row span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lg-row b { font-variant-numeric: tabular-nums; }
.empty { display: grid; place-items: center; text-align: center; gap: 6px; padding: 26px 10px; color: var(--mut); } .empty svg { width: 34px; height: 34px; stroke: var(--line2); fill: none; stroke-width: 1.6; }

/* sign-in motion */
.hero .orb { position: absolute; border-radius: 50%; opacity: .9; animation: floaty 9s ease-in-out infinite alternate; }
.hero .orb.a { width: 14px; height: 14px; right: 18%; top: 22%; background: var(--brand-glow); } .hero .orb.b { width: 9px; height: 9px; right: 32%; top: 58%; background: #fcd34d; animation-duration: 12s; } .hero .orb.c { width: 20px; height: 20px; right: 10%; top: 70%; background: rgba(129, 140, 248, .8); animation-duration: 15s; }
@keyframes floaty { to { transform: translate(-26px, -42px); } }
.hero h1 em { background-size: 220% 100%; animation: shine 7s linear infinite; } @keyframes shine { to { background-position: -220% 0; } }
.hero h1, .hero p.lead, .feat, .hero .glass { animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; } .hero h1 em { animation: shine 7s linear infinite; }
.hero p.lead { animation-delay: .12s; } .feat:nth-child(1) { animation-delay: .22s; } .feat:nth-child(2) { animation-delay: .3s; } .feat:nth-child(3) { animation-delay: .38s; } .hero .glass { animation-delay: .5s; }
.authcard { animation: rise .7s cubic-bezier(.2, .8, .2, 1) .1s both; }

@media (max-width: 900px) {
  .pagehead { position: static; margin: 0 0 16px; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; background: none; } .pagehead.scrolled { box-shadow: none; } body::before { width: 380px; height: 380px; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none !important; } .chart .bar-r { animation: none !important; } .donut .seg { animation: none !important; stroke-dasharray: var(--len) calc(100 - var(--len)); } .confetti { display: none; }
}
@media print {
  body::before, body::after, #nprog, .confetti { display: none !important; } .pagehead { position: static; backdrop-filter: none; background: none; margin: 0 0 12px; padding: 0; }
  .pagehead h2 { color: #000; background: none; } .stat .kpi { color: #000; background: none; } #view > .card, #view > .grid > * { animation: none; }
}
