/* Taskly — Nova (the assistant), the Home hero network and extra graphics.
 * Loaded last. Animations here are listed in the reduced-motion block at the end.
 */

/* ============================================================ Nova: orb */
button.nova-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 900; width: 60px; height: 60px; min-height: 0; padding: 0;
  border: 0; border-radius: 50%; background: #0B1030; cursor: pointer;
  box-shadow: 0 10px 30px rgba(44, 88, 221, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: transform 260ms cubic-bezier(0.2, 1.3, 0.4, 1), box-shadow 260ms ease, opacity 200ms ease;
}
button.nova-fab:hover { background: #0B1030; transform: scale(1.08); box-shadow: 0 14px 38px rgba(52, 208, 207, 0.45); }
button.nova-fab::before, button.nova-fab::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid rgba(52, 208, 207, 0.5);
  animation: nova-ping 3.2s ease-out infinite; pointer-events: none;
}
button.nova-fab::after { animation-delay: 1.6s; border-color: rgba(161, 73, 212, 0.45); }
@keyframes nova-ping { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.5); opacity: 0; } }
.nova-orb { display: block; width: 100%; height: 100%; border-radius: 50%; }
body.locked .nova-fab, body.locked .nova, body.nova-open .nova-fab { display: none; }

/* ========================================================== Nova: panel */
.nova {
  position: fixed; right: 22px; bottom: 22px; z-index: 950; width: min(390px, calc(100vw - 24px));
  max-height: min(700px, calc(100vh - 96px)); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  border-radius: 24px; color: var(--text); overflow: hidden;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--border); box-shadow: 0 30px 80px rgba(8, 12, 40, 0.35);
  transform-origin: 100% 100%; animation: nova-in 380ms cubic-bezier(0.2, 1.1, 0.3, 1);
}
.nova[hidden] { display: none; }
@keyframes nova-in { from { opacity: 0; transform: translateY(18px) scale(0.9); } }
.nova-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 10px 20px; }
.nova-head h2 { margin: 0; font-size: 1.05rem; letter-spacing: 0.02em; }
.nova-state { margin: 0; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.nova[data-state="listening"] .nova-state { color: var(--tone-teal, var(--accent-strong)); }
.nova[data-state="thinking"] .nova-state { color: var(--tone-violet, var(--accent-strong)); }
.nova[data-state="speaking"] .nova-state { color: var(--accent-strong); }
.nova-tools { display: flex; gap: 4px; }
.nova-tools button.icon-button { width: 34px; height: 34px; min-height: 0; padding: 0; }
#novaVoice[aria-pressed="false"] { opacity: 0.45; }
.nova-stage {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 8px 16px 12px; margin: 0 12px;
  border-radius: 18px; background: radial-gradient(120% 120% at 50% 0%, #1A2360 0%, #0B1030 55%, #070A1E 100%);
}
.nova-stage::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 22px 22px; -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent);
}
.nova-orb.big { position: relative; width: 150px; height: 150px; }
.nova-heard { position: relative; min-height: 1.3em; margin: 0; font-size: 0.88rem; color: #C9D4FF; text-align: center; font-style: italic; overflow-wrap: anywhere; }
.nova-log { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 4px; overflow-y: auto; min-height: 60px; }
.nova-msg { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: 0.9rem; line-height: 1.4; overflow-wrap: anywhere; animation: nova-msg 320ms cubic-bezier(0.2, 0.9, 0.3, 1) backwards; }
@keyframes nova-msg { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
.nova-msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 6px; }
.nova-msg.bot { align-self: flex-start; background: var(--surface-3); color: var(--text); border-bottom-left-radius: 6px; }
.nova-msg ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 0.82rem; color: var(--text-2); }
.nova-msg li::before { content: "› "; color: var(--accent-strong); font-weight: 700; }
.nova-msg .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.nova-msg .row button { min-height: 28px; padding: 3px 12px; font-size: 0.8rem; }
.nova-chips { display: flex; gap: 6px; padding: 8px 16px 2px; overflow-x: auto; scrollbar-width: none; }
.nova-chips::-webkit-scrollbar { display: none; }
button.nova-chip { flex: none; min-height: 0; padding: 5px 12px; font: inherit; font-size: 0.78rem; font-weight: 500; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); border: 0; white-space: nowrap; }
button.nova-chip:hover { background: var(--accent); color: var(--accent-text); }
.nova-form { display: flex; align-items: center; gap: 8px; padding: 10px 14px 6px; }
.nova-form input { flex: 1; min-width: 0; min-height: 40px; border-radius: 999px; padding: 8px 14px; }
button.nova-mic { position: relative; flex: none; width: 42px; height: 42px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; border: 0; color: #fff; background: linear-gradient(135deg, #2C58DD, #34D0CF); }
button.nova-mic:hover { background: linear-gradient(135deg, #2C58DD, #34D0CF); filter: brightness(1.08); }
button.nova-mic .icon { width: 19px; height: 19px; }
button.nova-mic[aria-pressed="true"] { background: var(--danger-fill, #E5484D); }
button.nova-mic[aria-pressed="true"]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--danger-fill, #E5484D); animation: nova-ping 1.4s ease-out infinite; }
button.nova-mic:disabled { background: var(--surface-3); color: var(--muted); }
.nova-note { margin: 0; padding: 0 18px 12px; font-size: 0.7rem; color: var(--muted); line-height: 1.35; }
@media (max-width: 760px) {
  button.nova-fab { right: 14px; bottom: 86px; width: 52px; height: 52px; }
  .nova { right: 8px; left: 8px; bottom: 78px; width: auto; max-height: calc(100vh - 150px); }
  .nova-orb.big { width: 112px; height: 112px; }
}

/* ====================================================== Home hero network */
.hero-net { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }

/* ============================================================== Graphics */
/* The two gradient headers move very slowly. */
.review-hero, .journey-hero { background-size: 180% 180%; animation: hero-pan 16s ease-in-out infinite alternate; }
@keyframes hero-pan { from { background-position: 0% 30%; } to { background-position: 100% 70%; } }
/* Two small lights orbit the level ring. */
.level-ring { position: relative; }
.level-ring::before, .level-ring::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 12px 3px rgba(255, 255, 255, 0.7); animation: orbit 7s linear infinite;
}
.level-ring::after { width: 6px; height: 6px; margin: -3px; background: #7FE6E5; box-shadow: 0 0 10px 3px rgba(52, 208, 207, 0.8); animation-duration: 11s; animation-direction: reverse; }
@keyframes orbit { from { transform: rotate(0deg) translateX(78px); } to { transform: rotate(360deg) translateX(78px); } }
/* Badge medals carry a drawn symbol and lean toward the pointer. */
.badges { perspective: 900px; }
.badge-card { transform-style: preserve-3d; will-change: transform; }
.badge-medal svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.badge-card.earned .badge-medal { animation: medal-glow 3.4s ease-in-out infinite; }
@keyframes medal-glow { 50% { box-shadow: 0 6px 22px color-mix(in srgb, var(--b) 62%, transparent); } }
/* The progress ring on Home draws itself in. */
.home-hero .ring { animation: ring-in 900ms cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
@keyframes ring-in { from { transform: scale(0.8) rotate(-40deg); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  button.nova-fab::before, button.nova-fab::after, .nova, .nova-msg, button.nova-mic[aria-pressed="true"]::after,
  .review-hero, .journey-hero, .level-ring::before, .level-ring::after, .badge-card.earned .badge-medal,
  .home-hero .ring { animation: none !important; }
  button.nova-fab { transition: none; }
}

/* Nova asks before it changes anything */
.nova-proposal { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 12px; background: var(--surface-2); }
.nova-proposal-title { margin: 0 0 6px; font-weight: 700; font-size: 0.9rem; }
.nova-proposal ul { margin: 0 0 10px; padding-left: 18px; font-size: 0.84rem; display: grid; gap: 2px; }
.nova-proposal .row { display: flex; gap: 8px; }
.nova-proposal.decided { opacity: 0.55; }
