/* ==========================================================================
   Animation Styles — Unit chart, timeline thread, animation overrides
   Loaded only on pages with timeline_thread: true
   ========================================================================== */

/* --- Timeline Drawing Thread --- */

.timeline-thread {
  position: absolute;
  top: 0;
  left: 1rem; /* matches .timeline-wrapper::before left position */
  width: 2px;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  view-transition-name: none; /* exclude from view transition snapshots */
}

.timeline-thread line {
  stroke: var(--accent, #1a5276);
  stroke-width: 1.5;
  opacity: 0.4;
}

.timeline-thread .thread-dot {
  fill: var(--accent, #1a5276);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.timeline-thread .thread-dot.is-reached {
  opacity: 0.8;
}

[data-theme="dark"] .timeline-thread line {
  stroke: #5dade2;
}

[data-theme="dark"] .timeline-thread .thread-dot {
  fill: #5dade2;
}

@media (max-width: 600px) {
  .timeline-thread {
    left: 0.75rem; /* matches mobile .timeline-wrapper::before at 600px */
  }
}

/* --- Unit Chart (37 vs 0) --- */

.unit-chart {
  display: flex;
  gap: 2rem;
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--border-light, #e2e2e2);
  border-radius: 4px;
  background: var(--bg-secondary, #fafafa);
}

.unit-chart__section {
  flex: 1;
}

.unit-chart__label {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.unit-chart__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-height: 2rem;
}

.unit-chart__grid .unit {
  width: 8px;
  height: 8px;
  border-radius: 1px;
}

.unit-chart__grid .unit--filled {
  background: var(--accent, #1a5276);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.unit-chart__grid .unit--filled.is-visible {
  opacity: 1;
}

.unit-chart__grid .unit--empty {
  border: 1px solid var(--border-medium, #ccc);
  background: transparent;
}

.unit-chart__count {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Dark mode */
[data-theme="dark"] .unit-chart {
  background: var(--bg-secondary, #1a1a1a);
  border-color: var(--border-light, #333);
}

[data-theme="dark"] .unit-chart__grid .unit--filled {
  background: #5dade2;
}

[data-theme="dark"] .unit-chart__grid .unit--empty {
  border-color: var(--border-medium, #444);
}

/* Mobile stack */
@media (max-width: 480px) {
  .unit-chart {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .timeline-thread .thread-dot {
    transition: none;
  }

  .unit-chart__grid .unit--filled {
    transition: none;
  }
}
