/* ============================================
   SECTION B: Contextual Comparisons
   ============================================ */

.comparisons {
  background: var(--bg-secondary);
}

/* Toggle Buttons */
.toggle-group {
  display: inline-flex;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  padding: 3px;
  margin-bottom: 2.5rem;
}

.toggle-group__btn {
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.toggle-group__btn:hover {
  color: var(--text-secondary);
}

.toggle-group__btn.is-active {
  background: var(--blue-accent);
  color: #fff;
}

/* Comparison Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.comparison-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.comparison-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.comparison-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  background: rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--blue-accent);
  font-size: 1.25rem;
}

.comparison-card__number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.comparison-card__label {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.comparison-card__source {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Salary Equivalence */
.salary-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  margin-bottom: 3rem;
}

.salary-stat__number {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--amber-warning);
  line-height: 1.1;
}

.salary-stat__label {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* Physical Metaphors */
.metaphors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.metaphor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.metaphor-card__visual {
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.metaphor-card__visual--stack,
.metaphor-card__visual--mcg {
  height: 200px;
  align-items: center;
}

.metaphor-card__stat {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cyan-info);
  margin-bottom: 0.5rem;
}

.metaphor-card__text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Cash Stack Animation ── */
.cash-stack {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  position: relative;
}

.cash-stack__pile {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 100%;
  justify-content: flex-start;
  position: relative;
}

.cash-note {
  width: 90px;
  height: 6px;
  flex-shrink: 0;
  background:
    linear-gradient(90deg,
      #1a6b3c 0%, #28844a 15%, #33a35c 35%,
      #43c46e 50%,
      #33a35c 65%, #28844a 85%, #1a6b3c 100%);
  border-radius: 1px;
  opacity: 0;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  will-change: transform, opacity;
}

/* Transparent security strip on each note */
.cash-note::after {
  content: '';
  position: absolute;
  left: 35%;
  top: 0;
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.12);
}

/* Height measure line */
.cash-stack__measure {
  position: absolute;
  right: 12%;
  bottom: 0;
  top: 8px;
  width: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cash-stack__measure-line {
  width: 1px;
  height: 0;
  background: linear-gradient(to top,
    transparent 0%,
    var(--cyan-info) 10%,
    var(--cyan-info) 90%,
    transparent 100%);
  transition: height 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cash-stack.is-measured .cash-stack__measure-line {
  height: 100%;
}

.cash-stack__measure-tip {
  position: absolute;
  top: -4px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--cyan-info);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease 1.6s, transform 0.4s ease 1.6s;
}

.cash-stack.is-measured .cash-stack__measure-tip {
  opacity: 1;
  transform: translateY(0);
}

/* ── Rotating MCG ── */
.mcg-scene {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 500px;
}

.mcg-stadium {
  position: relative;
  width: 150px;
  height: 150px;
  transform-style: preserve-3d;
  transform: rotateX(62deg) rotateZ(0deg);
}

.mcg-stadium.is-spinning {
  animation: mcg-rotate 18s linear infinite;
}

@keyframes mcg-rotate {
  from { transform: rotateX(62deg) rotateZ(0deg); }
  to   { transform: rotateX(62deg) rotateZ(360deg); }
}

.mcg-stadium__tier {
  position: absolute;
  border-radius: 50%;
}

/* Outer wall — the main structure */
.mcg-stadium__tier--outer {
  inset: 0;
  border: 3px solid #64748b;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(100, 116, 139, 0.12) 0deg 5deg,
      transparent 5deg 10deg
    );
  box-shadow:
    0 8px 0 -1px rgba(71, 85, 105, 0.5),
    0 12px 0 -1px rgba(51, 65, 85, 0.35),
    0 16px 0 -1px rgba(30, 41, 59, 0.2),
    0 0 30px rgba(245, 158, 11, 0.08);
}

/* Middle tier */
.mcg-stadium__tier--middle {
  inset: 18%;
  border: 2px solid #475569;
  background: rgba(71, 85, 105, 0.15);
  box-shadow: 0 4px 0 -1px rgba(71, 85, 105, 0.3);
}

/* Inner tier */
.mcg-stadium__tier--inner {
  inset: 33%;
  border: 2px solid #334155;
  background: rgba(51, 65, 85, 0.12);
}

/* Green oval field */
.mcg-stadium__field {
  position: absolute;
  inset: 42%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #15803d 0%, #14532d 80%, #0f3d1c 100%);
  border: 1px solid #16a34a;
}

/* Money fill overlay — gold/green pulsing glow in the stands */
.mcg-stadium__money {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse,
    transparent 55%,
    rgba(34, 197, 94, 0.12) 60%,
    rgba(245, 158, 11, 0.15) 75%,
    rgba(34, 197, 94, 0.08) 90%,
    transparent 100%);
  opacity: 0;
  animation: mcg-money-pulse 3s ease-in-out infinite alternate;
  animation-play-state: paused;
}

.mcg-stadium.is-spinning .mcg-stadium__money {
  opacity: 1;
  animation-play-state: running;
}

@keyframes mcg-money-pulse {
  from { opacity: 0.5; }
  to   { opacity: 1; }
}

/* Ground shadow beneath the stadium */
.mcg-shadow {
  width: 130px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.25) 0%, transparent 70%);
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.6s ease 0.3s;
}

.mcg-stadium.is-spinning ~ .mcg-shadow {
  opacity: 1;
}

/* Reduced motion: no animations */
@media (prefers-reduced-motion: reduce) {
  .mcg-stadium.is-spinning {
    animation: none;
    transform: rotateX(62deg) rotateZ(-20deg);
  }
  .mcg-stadium.is-spinning .mcg-stadium__money {
    animation: none;
    opacity: 0.7;
  }
  .cash-note {
    opacity: 1 !important;
  }
  .cash-stack__measure-line {
    height: 100% !important;
    transition: none !important;
  }
  .cash-stack__measure-tip {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: none !important;
  }
}

@media (max-width: 768px) {
  .metaphors {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .metaphor-card__visual--stack,
  .metaphor-card__visual--mcg {
    height: 180px;
  }

  .mcg-stadium {
    width: 130px;
    height: 130px;
  }
}

@media (max-width: 480px) {
  .toggle-group {
    flex-wrap: wrap;
  }

  .metaphor-card__visual--stack,
  .metaphor-card__visual--mcg {
    height: 160px;
  }

  .cash-note {
    width: 70px;
    height: 5px;
  }

  .mcg-stadium {
    width: 110px;
    height: 110px;
  }
}
