/* The moving panels ({{glance}}, data/glances.json). Tokens for every colour. Only transform,
   opacity (never from 0) and stroke offsets animate. The panel is complete at rest: reduced motion or
   Pause motion stills it on its finished state (css/motion.css rule 3). */
.glance {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 300px;
  max-width: 100%;
  padding: 28px 22px 48px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-2) 40%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.hero__visual:has(> .glance) { padding: 0; background: none; border: 0; box-shadow: none; }
.glance__wash { position: absolute; inset: 0; z-index: -1; }
.glance__blob { position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50%; filter: blur(42px); opacity: 0.5; }
.glance__blob--a { left: -10%; top: -15%; background: var(--accent); }
.glance__blob--b { right: -15%; top: 20%; background: #2bb3a3; }
.glance__blob--c { left: 25%; bottom: -30%; background: #f2a65a; }

.glance__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.glance__card {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-width: 0;
}
.glance__card:nth-child(even) { margin-top: 18px; }
.glance__card--list, .glance__card--bars { grid-column: 1 / -1; margin-top: 0; }
.glance__label { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.glance__value { margin: 2px 0 0; font-size: 1.75rem; font-weight: 600; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.glance__unit { font-size: 1.125rem; font-weight: 500; color: var(--ink); }
.glance__ringrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.glance__ring { display: block; flex: none; transform: rotate(-90deg); }
.glance__track, .glance__fill { fill: none; stroke-width: 5; }
.glance__track { stroke: var(--line); }
.glance__fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
.glance__fill--0 { stroke-dashoffset: 100; }
.glance__fill--1 { stroke-dashoffset: 90; }
.glance__fill--2 { stroke-dashoffset: 80; }
.glance__fill--3 { stroke-dashoffset: 70; }
.glance__fill--4 { stroke-dashoffset: 60; }
.glance__fill--5 { stroke-dashoffset: 50; }
.glance__fill--6 { stroke-dashoffset: 40; }
.glance__fill--7 { stroke-dashoffset: 30; }
.glance__fill--8 { stroke-dashoffset: 20; }
.glance__fill--9 { stroke-dashoffset: 10; }
.glance__fill--10 { stroke-dashoffset: 0; }
.glance__spark { display: block; margin-top: 6px; max-width: 100%; }
.glance__spark path { fill: none; stroke: #2bb3a3; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.glance__bars { display: flex; align-items: flex-end; gap: 8px; height: 72px; margin-top: 8px; }
.glance__bar { flex: 1; border-radius: 5px 5px 2px 2px; background: var(--accent); transform-origin: bottom; }
.glance__bar:nth-child(3n + 2) { background: #2bb3a3; }
.glance__bar:nth-child(3n) { background: #f2a65a; }
.glance__bar--1 { height: 10%; }
.glance__bar--2 { height: 20%; }
.glance__bar--3 { height: 30%; }
.glance__bar--4 { height: 40%; }
.glance__bar--5 { height: 50%; }
.glance__bar--6 { height: 60%; }
.glance__bar--7 { height: 70%; }
.glance__bar--8 { height: 80%; }
.glance__bar--9 { height: 90%; }
.glance__bar--10 { height: 100%; }
.glance__list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.glance__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.glance__who { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.glance__status { position: relative; display: inline-grid; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, #f2a65a 22%, var(--surface)); color: var(--ink); font-size: 0.875rem; }
.glance__status--done { background: color-mix(in srgb, #2f9e6e 18%, var(--surface)); }
.glance__status { white-space: nowrap; }
/* The old status, drawn over the new one by the stylesheet and faded out while the panel moves. At
   rest (no motion) it is not drawn at all, so the row shows its finished state. */
.glance__status[data-was]::before {
  content: attr(data-was);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: color-mix(in srgb, #f2a65a 22%, var(--surface));
  opacity: 0;
}
.glance__stars { display: inline-flex; gap: 1px; margin-right: 8px; vertical-align: -1px; }
.glance__star { fill: #e5a200; }
.glance__star--off { fill: var(--line-strong); }
.glance__toast {
  grid-column: 1 / -1;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
  color: var(--ink);
  white-space: nowrap;
}
.glance__dot { width: 8px; height: 8px; border-radius: 50%; background: #2bb3a3; }

@media (max-width: 559.98px) {
  .glance { padding: 20px 14px 44px; }
  .glance__value { font-size: 1.375rem; }
  .glance__card { padding: 10px 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .glance__blob--a { animation: glance-drift-a 14s ease-in-out infinite alternate; }
  .glance__blob--b { animation: glance-drift-b 17s ease-in-out infinite alternate; }
  .glance__blob--c { animation: glance-drift-c 20s ease-in-out infinite alternate; }
  .glance__card { animation: glance-float 6s ease-in-out infinite alternate; }
  .glance__card--n1 { animation-delay: -1.5s; }
  .glance__card--n2 { animation-delay: -3s; }
  .glance__card--n3 { animation-delay: -4.5s; }
  .glance__toast { animation: glance-float 5s ease-in-out infinite alternate; animation-delay: -2s; }
  .glance__dot { animation: glance-beat 1.6s ease-in-out infinite; }
  .glance__fill { animation: glance-ring 1.8s ease-out both; }
  .glance__spark path { animation: glance-line 1.8s ease-out both; }
  .glance__bar { animation: glance-grow 1.2s cubic-bezier(.2, .8, .2, 1) both; }
  .glance__bar--d1 { animation-delay: 0.08s; }
  .glance__bar--d2 { animation-delay: 0.16s; }
  .glance__bar--d3 { animation-delay: 0.24s; }
  .glance__bar--d4 { animation-delay: 0.32s; }
  .glance__bar--d5 { animation-delay: 0.4s; }
  .glance__bar--d6 { animation-delay: 0.48s; }
  .glance__row { animation: glance-slide 0.8s ease-out both; }
  .glance__row--d1 { animation-delay: 0.15s; }
  .glance__row--d2 { animation-delay: 0.3s; }
  .glance__row--d3 { animation-delay: 0.45s; }
  .glance__status[data-was]::before { animation: glance-flip 6s ease-in-out infinite; }
}
@keyframes glance-drift-a { to { transform: translate(18%, 12%) scale(1.1); } }
@keyframes glance-drift-b { to { transform: translate(-16%, -10%) scale(0.95); } }
@keyframes glance-drift-c { to { transform: translate(10%, -14%) scale(1.15); } }
@keyframes glance-float { from { transform: translateY(-5px); } to { transform: translateY(5px); } }
@keyframes glance-beat { 50% { transform: scale(1.5); } }
@keyframes glance-ring { from { stroke-dashoffset: 100; } }
@keyframes glance-line { from { stroke-dashoffset: 1; } }
@keyframes glance-grow { from { transform: scaleY(0.05); } }
@keyframes glance-slide { from { transform: translateX(-10px); } }
/* The old status shows, then fades to reveal the new one, and the loop starts again. */
@keyframes glance-flip { 0% { opacity: 1; } 40% { opacity: 1; } 55% { opacity: 0; } 100% { opacity: 0; } }

html.motion-paused .glance__blob,
html.motion-paused .glance__card,
html.motion-paused .glance__toast,
html.motion-paused .glance__dot,
html.motion-paused .glance__fill,
html.motion-paused .glance__spark path,
html.motion-paused .glance__bar,
html.motion-paused .glance__row,
html.motion-paused .glance__status::before { animation: none; }

/* Two panels side by side are the same height. */
.shots:has(> .glance) { align-items: stretch; }
