/* =============================================================================
   AS-2026 ANIMATIONS — "Quiet Pulse" layer
   -----------------------------------------------------------------------------
   Subtle, Swiss, measured animations that bring the marketplace to life
   without shouting. Mix of Proposals 1 and 3 from the strategic discussion:
   
   1. Pulsing LIVE badge + last-trade timer
   2. Progress bar that fills on viewport entry
   3. Number counter animation on stat cards
   4. Hover depth on artwork cards
   5. Community feed slide-in on refresh
   6. Subtle ticker strip under nav (minimal, Swiss)
   ========================================================================== */

/* === 1. LIVE badge — green dot that breathes === */
.hm-chip[class*="live"], .mkt-chip.live, span.hm-chip:not([class*="expected"]):not([class*="coming"]) {
  position: relative;
}

.as-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--ft);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--green, #6FB574);
  padding: 2px 8px 2px 7px;
  border-radius: 10px;
  background: rgba(111,181,116,0.10);
  border: 0.5px solid rgba(111,181,116,0.30);
  text-transform: uppercase;
}

.as-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6FB574;
  animation: as-live-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes as-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(111,181,116,0.6); }
  50% { opacity: 0.7; transform: scale(1.15); box-shadow: 0 0 0 4px rgba(111,181,116,0); }
}

.as-last-trade {
  font-family: var(--fm);
  font-size: 10px;
  color: var(--cream-40, rgba(232,224,196,0.5));
  margin-top: 6px;
  font-weight: 400;
}

/* === 2. Progress bar (primary market) === */
.as-progress {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 0.5px solid var(--divider, rgba(232,224,196,0.08));
}

.as-progress-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--fm);
  font-size: 9.5px;
  color: var(--cream-40, rgba(232,224,196,0.55));
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.as-progress-head strong {
  color: var(--gold, #B8913C);
  font-weight: 500;
}

.as-progress-track {
  position: relative;
  height: 3px;
  background: rgba(232,224,196,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.as-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep, #8A6A28), var(--gold, #B8913C));
  border-radius: 2px;
  width: 0;
  transition: width 1.4s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* When the card enters viewport, JS sets .as-visible, CSS animates the fill */
.as-progress[data-progress].as-visible .as-progress-fill {
  width: var(--fill-pct, 0%);
}

/* === 3. Number counter — stat cards === */
.as-counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* === 4. Card hover — reveal depth, metadata === */
.as-card-hover {
  position: relative;
  transition: transform 0.2s ease, border-color 0.25s ease;
}

.as-card-hover:hover {
  transform: translateY(-2px);
}

.as-card-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(8,17,31,0.92), rgba(8,17,31,0));
  padding: 20px 14px 12px;
  font-family: var(--fm);
  font-size: 10px;
  color: var(--cream-60, rgba(232,224,196,0.72));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: none;
}

.as-card-hover:hover .as-card-meta {
  opacity: 1;
  transform: translateY(0);
}

.as-card-meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.as-card-meta-l { color: var(--cream-40, rgba(232,224,196,0.5)); font-size: 9px; letter-spacing: 0.4px; text-transform: uppercase; }
.as-card-meta-v { color: var(--cream, #E8E0C4); }

/* === 5. Community feed — slide in from top on refresh === */
.as-feed-new {
  animation: as-slide-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes as-slide-in {
  0% { opacity: 0; transform: translateY(-12px); max-height: 0; }
  30% { opacity: 0; transform: translateY(-8px); max-height: 100px; }
  100% { opacity: 1; transform: translateY(0); max-height: 100px; }
}

.as-feed-leaving {
  animation: as-slide-out 0.4s ease forwards;
}

@keyframes as-slide-out {
  to { opacity: 0; transform: translateX(10px); }
}

/* === 6. Ticker strip — under nav === */
.as-ticker {
  background: var(--surface, #08111F);
  border-bottom: 0.5px solid var(--border, rgba(184,145,60,0.16));
  height: 32px;
  overflow: hidden;
  position: relative;
}

.as-ticker-track {
  display: flex;
  gap: 48px;
  align-items: center;
  height: 100%;
  padding-left: 100%;
  animation: as-ticker-scroll 60s linear infinite;
  white-space: nowrap;
}

.as-ticker:hover .as-ticker-track {
  animation-play-state: paused;
}

@keyframes as-ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.as-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--fm);
  font-size: 11px;
  color: var(--cream-60, rgba(232,224,196,0.72));
  white-space: nowrap;
}

.as-ticker-item strong {
  color: var(--cream, #E8E0C4);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.as-ticker-delta-up { color: var(--green, #6FB574); font-weight: 500; }
.as-ticker-delta-down { color: var(--red, #D45A5A); font-weight: 500; }
.as-ticker-delta-flat { color: var(--cream-40, rgba(232,224,196,0.5)); }

.as-ticker-sep {
  color: var(--gold-border, rgba(184,145,60,0.3));
  font-size: 8px;
}

/* === 7. Page entrance — sections fade-in on scroll === */
.as-fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.as-fade-in.as-visible {
  opacity: 1;
  transform: translateY(0);
}

/* === 8. Reduce motion for accessibility === */
@media (prefers-reduced-motion: reduce) {
  .as-live-dot { animation: none; }
  .as-ticker-track { animation: none; transform: none; padding-left: 0; }
  .as-fade-in { opacity: 1; transform: none; transition: none; }
  .as-progress-fill { transition: none; }
  .as-card-hover:hover { transform: none; }
}

/* End AS-2026 animations overlay */
