/* Goals feature: intentions board, status picker, reactions. */

/* ================= intentions board ================= */
.goals { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-4); }
.goals-head { display: grid; gap: 2px; }
.goals-title { font-size: var(--fs-xl); line-height: 1.15; font-style: italic; letter-spacing: -0.005em; }
.goals-meter {
  position: relative; height: 2px; margin-top: var(--s-3); border-radius: var(--r-pill);
  background: var(--glass-line-strong); overflow: hidden;
}
.goals-meter-fill {
  position: absolute; inset: 0; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--lamp-deep), var(--lamp));
  box-shadow: 0 0 10px var(--lamp-glow);
  transition: transform var(--t-slow) var(--ease);
}
.goals-meter.is-full .goals-meter-fill { background: linear-gradient(90deg, var(--lamp), var(--lamp-soft)); }
.goals-progress {
  margin: var(--s-1) 0 0; font-size: var(--fs-xs); color: var(--text-dim);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
}

.goals-group-head {
  display: flex; align-items: center; gap: var(--s-2); min-width: 0;
  font-size: var(--fs-sm); margin-bottom: var(--s-2);
}
.goals-dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--c, var(--lamp)); box-shadow: 0 0 8px var(--c, var(--lamp));
}
.goals-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.goals-count {
  margin-left: auto; flex: none; font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-faint); font-variant-numeric: tabular-nums;
}

.goals-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.goals-item {
  position: relative; display: flex; align-items: flex-start; gap: var(--s-2);
  padding: 6px 6px 6px 4px; border-radius: var(--r-sm);
  transition: background var(--t-fast) var(--ease), opacity var(--t-med) var(--ease);
}
.goals-item:hover, .goals-item:focus-within { background: rgba(243, 233, 216, 0.04); }
.goals-item.is-new { animation: goals-bloom var(--t-slow) var(--ease) both; }
@keyframes goals-bloom {
  from { opacity: 0; filter: blur(4px); box-shadow: 0 0 0 0 transparent; }
  40% { opacity: 1; filter: blur(0); box-shadow: 0 0 22px var(--lamp-glow); }
  to { box-shadow: 0 0 0 0 transparent; }
}

/* checkbox: a little round lamp switch */
.goals-check {
  flex: none; width: 22px; height: 22px; margin: 0; padding: 0; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  border: 1.5px solid var(--glass-line-strong); background: rgba(7, 9, 15, 0.4); color: var(--ink-900);
  transition: background var(--t-med) var(--ease), border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.goals-check::before { /* larger touch target without changing the visual */
  content: ''; position: absolute; inset: -11px;
}
.goals-check.is-static::before { display: none; }
button.goals-check:hover { border-color: var(--lamp); box-shadow: 0 0 0 3px var(--lamp-glow); }
.goals-check svg { width: 14px; height: 14px; stroke-width: 2.4; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset var(--t-med) var(--ease); }
.goals-item.is-done .goals-check { background: var(--lamp); border-color: var(--lamp); box-shadow: 0 0 12px var(--lamp-glow); }
.goals-item.is-done .goals-check svg { stroke-dashoffset: 0; transition-delay: 80ms; }
.goals-check.is-static { width: 18px; height: 18px; margin: 2px; }
.goals-check.is-static svg { width: 11px; height: 11px; }
.goals-glow { animation: goals-glow 1.4s var(--ease) both; }
@keyframes goals-glow { 0% { box-shadow: 0 0 0 0 var(--lamp-glow); } 30% { box-shadow: 0 0 0 7px var(--lamp-glow); } 100% { box-shadow: 0 0 12px var(--lamp-glow); } }

/* text with a strike-through that draws across (inline span, so it follows every wrapped line) */
.goals-text-wrap {
  flex: 1; min-width: 0; padding-top: 1px; font-size: var(--fs-sm); line-height: 1.45; overflow-wrap: anywhere;
}
.goals-text {
  color: var(--text);
  background-image: linear-gradient(var(--lamp-soft), var(--lamp-soft));
  background-repeat: no-repeat; background-position: 0 58%; background-size: 0% 1.5px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size 520ms var(--ease), color var(--t-med) var(--ease);
}
.goals-item.is-done .goals-text { background-size: 100% 1.5px; color: var(--text-faint); }

.goals-remove, .goals-cheer {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  min-width: 28px; height: 28px; margin: -3px 0; padding: 0 6px; border-radius: var(--r-pill);
  border: 1px solid transparent; background: transparent; color: var(--text-faint);
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
}
.goals-remove svg, .goals-cheer svg { width: 15px; height: 15px; }
.goals-remove { opacity: 0; }
.goals-item:hover .goals-remove, .goals-remove:focus-visible { opacity: 1; }
@media (hover: none) { .goals-remove { opacity: 0.7; } }
.goals-remove:hover { color: var(--text); background: rgba(243, 233, 216, 0.08); }

.goals-cheer { font-family: var(--font-mono); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.goals-cheer:hover { color: var(--rose); background: rgba(242, 143, 173, 0.08); }
.goals-cheer[aria-pressed='true'] { color: var(--rose); }
.goals-cheer[aria-pressed='true'] svg { fill: currentColor; filter: drop-shadow(0 0 6px var(--rose-glow)); }
.goals-cheers {
  flex: none; display: inline-flex; align-items: center; gap: 3px; padding-top: 2px;
  color: var(--rose); font-family: var(--font-mono); font-size: var(--fs-xs); font-variant-numeric: tabular-nums;
}
.goals-cheers[hidden] { display: none; }
.goals-cheers svg { width: 13px; height: 13px; fill: currentColor; }
.goals-pulse { animation: goals-pulse 700ms var(--ease); }
@keyframes goals-pulse { 30% { transform: scale(1.3); filter: drop-shadow(0 0 6px var(--rose-glow)); } }

/* add row */
.goals-add { position: relative; margin-top: var(--s-2); }
.goals-input { padding-right: 46px; font-size: var(--fs-sm); }
.goals-input:disabled { opacity: 0.55; cursor: not-allowed; }
.goals-add-btn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  border: 0; background: rgba(255, 179, 92, 0.14); color: var(--lamp);
  transition: background var(--t-fast), box-shadow var(--t-med);
}
.goals-add-btn svg { width: 16px; height: 16px; }
.goals-add-btn:hover:not(:disabled) { background: var(--lamp); color: var(--ink-900); box-shadow: var(--shadow-lamp); }
.goals-add-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.goals-hint { margin: var(--s-2) 0 0; font-size: var(--fs-xs); color: var(--text-faint); }
.goals-hint[hidden], .goals-count[hidden] { display: none; }

/* everyone else */
.goals-others-section { border-top: 1px solid var(--glass-line); padding-top: var(--s-4); }
.goals-others { display: grid; gap: var(--s-4); }
.goals-others:empty { display: none; }
.goals-others-empty, .goals-empty { margin: 0; font-size: var(--fs-xs); color: var(--text-faint); font-style: italic; }
.goals-others-empty[hidden], .goals-empty[hidden] { display: none; }
.goals-empty { padding-left: 16px; }
.goals-group { border-radius: var(--r-md); margin: -6px; padding: 6px; transition: opacity var(--t-slow) var(--ease), filter var(--t-slow) var(--ease); }
.goals-group.is-new { animation: goals-bloom var(--t-slow) var(--ease) both; }
.goals-group.is-gone { opacity: 0.45; filter: saturate(0.4); }
.goals-group.is-gone .goals-dot { box-shadow: none; }

.goals-status-slot { display: contents; }
.goals-status {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden;
  padding: 1px 8px 1px 6px; border-radius: var(--r-pill); border: 1px solid var(--glass-line);
  font-size: 0.6875rem; color: var(--text-dim); white-space: nowrap;
}
.goals-status svg { width: 12px; height: 12px; flex: none; }
.goals-status-note { overflow: hidden; text-overflow: ellipsis; color: var(--text-faint); }
.goals-status.is-focus { color: var(--lamp-soft); }
.goals-status.is-break { color: var(--rose); }
.goals-status.is-stuck { color: var(--warn); border-color: rgba(245, 199, 107, 0.4); background: rgba(245, 199, 107, 0.08); }
.goals-status.is-away, .goals-status.is-gone { color: var(--text-faint); }

/* highlight a member who just asked for help (also applied to their desk tile in #mount-stage) */
.status-flash { animation: status-flash 1.5s var(--ease-in-out) 3; }
@keyframes status-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 199, 107, 0); }
  50% { box-shadow: 0 0 0 2px rgba(245, 199, 107, 0.55), 0 0 28px rgba(245, 199, 107, 0.3); }
}

/* ================= shared overlay layer ================= */
.react-layer { position: fixed; inset: 0; pointer-events: none; z-index: var(--z-overlay); overflow: hidden; contain: strict; }
.goals-spark {
  position: absolute; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%;
  background: var(--lamp-soft); box-shadow: 0 0 6px 1px var(--lamp), 0 0 12px var(--lamp-glow);
  will-change: transform, opacity;
}
.goals-spark.is-soft { width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; background: var(--lamp); }
.goals-spark-ring {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 1.5px solid var(--lamp); box-shadow: 0 0 14px var(--lamp-glow);
}
.goals-heart-pop {
  position: absolute; color: var(--rose); font-size: 18px; line-height: 1;
  text-shadow: 0 0 12px var(--rose-glow); will-change: transform, opacity;
}
.react-particle {
  position: absolute; line-height: 1; font-size: 26px; user-select: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35)); will-change: transform, opacity;
}
.react-caption {
  position: absolute; white-space: nowrap; padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--glass-strong); border: 1px solid rgba(242, 143, 173, 0.45); color: var(--text);
  font-size: var(--fs-xs); font-weight: 600; box-shadow: 0 0 22px var(--rose-glow);
}

/* ================= dock popovers (status + reactions) ================= */
.status-wrap, .react-wrap { position: relative; }
.status-pop:not(.open), .react-pop:not(.open) {
  visibility: hidden;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), visibility 0s linear var(--t-med);
}
.status-pop .eyebrow { margin: 0 0 var(--s-3); }
/* floating version for narrow screens (the dock scrolls horizontally there, which would clip popovers) */
.popover.goals-floating {
  position: fixed; left: var(--s-2); right: var(--s-2); bottom: calc(var(--dock-h) + var(--s-4));
  min-width: 0; max-width: 420px; margin: 0 auto; z-index: var(--z-modal);
}

/* status button */
.status-btn .status-btn-icon { display: grid; place-items: center; }
.status-btn-dot {
  position: absolute; right: 7px; bottom: 7px; width: 8px; height: 8px; border-radius: 50%;
  border: 2px solid var(--ink-900); background: var(--lamp);
  transition: background var(--t-med) var(--ease), box-shadow var(--t-med);
}
.status-btn[data-status='focus'] { color: var(--lamp-soft); }
.status-btn[data-status='break'] .status-btn-dot { background: var(--rose); }
.status-btn[data-status='stuck'] { color: var(--warn); border-color: rgba(245, 199, 107, 0.45); }
.status-btn[data-status='stuck'] .status-btn-dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.status-btn[data-status='away'] { color: var(--text-dim); }
.status-btn[data-status='away'] .status-btn-dot { background: var(--text-faint); }
.status-btn[aria-expanded='true'], .react-btn[aria-expanded='true'] { background: rgba(243, 233, 216, 0.12); border-color: var(--glass-line-strong); }

.status-pop { width: 320px; }
.status-options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.status-opt {
  display: flex; align-items: flex-start; gap: var(--s-2); text-align: left; min-height: 56px;
  padding: 10px; border-radius: var(--r-md); border: 1px solid var(--glass-line);
  background: rgba(243, 233, 216, 0.03); color: var(--text);
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-med) var(--ease);
}
.status-opt:hover { background: rgba(243, 233, 216, 0.07); border-color: var(--glass-line-strong); }
.status-opt-icon { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(243, 233, 216, 0.06); }
.status-opt-icon svg { width: 16px; height: 16px; }
.status-opt-text { display: grid; gap: 1px; min-width: 0; }
.status-opt-label { font-size: var(--fs-sm); font-weight: 600; line-height: 1.25; }
.status-opt-hint { font-size: 0.6875rem; color: var(--text-faint); line-height: 1.3; }
.status-opt[aria-pressed='true'] { border-color: rgba(255, 179, 92, 0.6); background: rgba(255, 179, 92, 0.09); box-shadow: 0 0 18px rgba(255, 179, 92, 0.12); }
.status-opt[aria-pressed='true'] .status-opt-icon { background: var(--lamp); color: var(--ink-900); box-shadow: 0 0 12px var(--lamp-glow); }
.status-opt.is-break[aria-pressed='true'] { border-color: rgba(242, 143, 173, 0.6); background: rgba(242, 143, 173, 0.08); box-shadow: 0 0 18px rgba(242, 143, 173, 0.12); }
.status-opt.is-break[aria-pressed='true'] .status-opt-icon { background: var(--rose); box-shadow: 0 0 12px var(--rose-glow); }
.status-opt.is-stuck[aria-pressed='true'] { border-color: rgba(245, 199, 107, 0.6); background: rgba(245, 199, 107, 0.08); box-shadow: none; }
.status-opt.is-stuck[aria-pressed='true'] .status-opt-icon { background: var(--warn); box-shadow: 0 0 12px rgba(245, 199, 107, 0.4); }
.status-opt.is-away[aria-pressed='true'] { border-color: var(--glass-line-strong); background: rgba(243, 233, 216, 0.06); box-shadow: none; }
.status-opt.is-away[aria-pressed='true'] .status-opt-icon { background: var(--text-dim); box-shadow: none; }

.status-note-form { margin-top: var(--s-3); display: grid; gap: 6px; }
.status-note-label { display: flex; align-items: baseline; font-size: var(--fs-xs); color: var(--text-dim); }
.status-note-count { margin-left: auto; font-family: var(--font-mono); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.status-note { font-size: var(--fs-sm); padding: 8px 12px; }
.status-note-hint { margin: 0; font-size: 0.6875rem; color: var(--text-faint); }

/* reactions */
.react-pop { min-width: 0; width: max-content; max-width: calc(100vw - 2 * var(--s-3)); padding: var(--s-2); border-radius: var(--r-pill); }
.react-pop.goals-floating { width: auto; border-radius: var(--r-lg); }
.react-row { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: center; }
.react-emoji {
  width: 42px; height: 42px; border-radius: 50%; border: 0; padding: 0; background: transparent;
  font-size: 22px; line-height: 1; display: grid; place-items: center;
  transition: background var(--t-fast), transform var(--t-med) var(--ease);
}
.react-emoji:hover { background: rgba(242, 143, 173, 0.12); transform: translateY(-2px) scale(1.08); }
.react-hi5 {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px 0 10px; margin-left: 4px;
  border-radius: var(--r-pill); border: 1px solid rgba(242, 143, 173, 0.4); background: rgba(242, 143, 173, 0.08);
  color: var(--text); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
  transition: background var(--t-fast), box-shadow var(--t-med) var(--ease);
}
.react-hi5:hover { background: rgba(242, 143, 173, 0.16); box-shadow: 0 0 20px var(--rose-glow); }
.react-hi5-emoji { font-size: 20px; }
.react-tap { animation: react-tap 420ms var(--ease); }
@keyframes react-tap { 40% { transform: scale(0.86); } 70% { transform: scale(1.1); } }

/* phones */
@media (max-width: 900px) {
  .status-pop { width: auto; }
}
@media (max-width: 400px) {
  .status-options { grid-template-columns: 1fr; }
  .status-opt { min-height: 48px; align-items: center; }
  .status-opt-hint { display: none; }
}

/* quiet during focus: no hover hops */
body[data-phase='focus'] .react-emoji:hover { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .goals-item.is-new, .goals-group.is-new, .goals-pulse, .goals-glow, .react-tap { animation: none; }
  .status-flash { animation: none; box-shadow: 0 0 0 2px rgba(245, 199, 107, 0.55); }
  .react-emoji:hover { transform: none; }
  .goals-text, .goals-check svg, .goals-meter-fill { transition: none; }
}
