/* ============================================
   Hero Chart Component
   Animated bar chart for the hero section
   showing unlocked savings over time.

   Dependencies: CSS custom properties from :root
   (--white, --accent, --warm-gray-*)
   ============================================ */

/* --- Base Layout --- */

.hero-chart {
  container-type: inline-size;
  aspect-ratio: 3.31;
  background: var(--white);
  padding: 4% 3% 0;
  display: flex;
  flex-direction: column;
}

.hero-chart-header {
  display: flex;
  align-items: center;
  gap: 1cqi;
}

.hero-chart-title {
  font-size: 2.9cqi;
  font-weight: 400;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

.hero-chart-period {
  font-size: 2.9cqi;
  font-weight: 400;
  color: var(--warm-gray-400);
}

.hero-chart-badge {
  font-size: 2cqi;
  font-weight: 600;
  color: var(--white);
  background: var(--accent);
  padding: 0.5cqi 1.4cqi;
  border-radius: 0.6cqi;
  min-width: 10cqi;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.hero-chart-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.5cqi;
  color: var(--warm-gray-200);
}

.hero-chart-nav svg {
  width: 2.5cqi;
  height: 2.5cqi;
}

.hero-chart-arrow {
  font-size: 3cqi;
  line-height: 1;
  cursor: default;
  user-select: none;
}

.hero-chart-body {
  flex: 1;
  position: relative;
  margin-top: 2%;
}

.hero-chart-area {
  position: absolute;
  left: 0;
  right: 7%;
  bottom: 14%;
  height: 72%;
}

/* --- Grid & Axes --- */

.hc-gridline {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.hc-gridline span {
  position: absolute;
  left: calc(100% + 1cqi);
  top: -1cqi;
  font-size: 1.5cqi;
  color: var(--warm-gray-400);
  font-weight: 400;
  white-space: nowrap;
}

.hc-axis-line {
  position: absolute;
  left: 0;
  right: 7%;
  bottom: 14%;
  height: 1.5px;
  background: #1a1a1a;
}

.hc-axis-line::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a1a1a;
}

.hc-axis-line::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-left: 6px solid #1a1a1a;
}

.hc-y-zero {
  position: absolute;
  right: 0;
  bottom: 12.5%;
  font-size: 1.5cqi;
  color: var(--warm-gray-400);
  font-weight: 400;
  width: 6%;
  text-align: left;
  padding-left: 1cqi;
}

.hc-month {
  position: absolute;
  bottom: 2%;
  font-size: 1.5cqi;
  color: #1a1a1a;
  font-weight: 400;
}

/* --- Bars --- */

.hc-bar {
  position: absolute;
  bottom: 0;
  width: 1cqi;
  border-radius: 0.3cqi 0.3cqi 0 0;
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hc-bar.visible {
  transform: scaleY(1);
}

.hc-bar-dark {
  background: #7b6d9a;
}

.hc-bar-light {
  background: rgba(150, 137, 164, 0.55);
}

/* --- Animation --- */

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
