/**
 * LEGACY — The Forever Collection
 * Pure heirloom elegance. Zero clutter.
 */

/* ═══════════════════════════════════════════════════════════════
   LEGACY SEAL
   ═══════════════════════════════════════════════════════════════ */

.legacy-seal {
  position: absolute;
  /* Wave E: vault tiles place the trash icon at right: 8px, so the seal
     disc sits beside it at right: 44px to keep both controls visible
     and tappable on touch. Other surfaces (where there's no trash) are
     unaffected because they don't render a sibling at that offset. */
  top: 10px;
  right: 44px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(20, 14, 6, 0.32);
  border: 1.5px solid rgba(212, 175, 55, 0.65);
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 1px 3px rgba(20, 14, 6, 0.25);
}

.legacy-seal::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.55);
  transition: all 0.3s ease;
}

.legacy-seal:hover {
  border-color: rgba(212, 175, 55, 0.7);
  transform: scale(1.1);
}

.legacy-seal:hover::before {
  border-color: rgba(212, 175, 55, 0.5);
}

/* Sealed state */
.legacy-seal.sealed {
  background: linear-gradient(135deg, #d4af37 0%, #b8962e 50%, #d4af37 100%);
  border-color: #d4af37;
  box-shadow: 
    0 0 12px rgba(212, 175, 55, 0.4),
    0 0 24px rgba(212, 175, 55, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.legacy-seal.sealed::before {
  background: rgba(255, 255, 255, 0.9);
  border-color: transparent;
  width: 6px;
  height: 6px;
}

/* Seal animation */
.legacy-seal.sealing {
  animation: sealEmboss 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes sealEmboss {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(0.85);
    background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
    border-color: #d4af37;
  }
  50% {
    transform: scale(1.3);
    box-shadow: 
      0 0 20px rgba(212, 175, 55, 0.6),
      0 0 40px rgba(212, 175, 55, 0.3);
  }
  100% {
    transform: scale(1);
    background: linear-gradient(135deg, #d4af37 0%, #b8962e 50%, #d4af37 100%);
    border-color: #d4af37;
    box-shadow: 
      0 0 12px rgba(212, 175, 55, 0.4),
      0 0 24px rgba(212, 175, 55, 0.2);
  }
}

/* Ripple effect */
.legacy-seal .seal-ripple {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.8);
  animation: sealRipple 0.8s ease-out forwards;
  pointer-events: none;
}

@keyframes sealRipple {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════
   LEGACY GALLERY OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.legacy-gallery-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #0a0a0f 0%, #12121a 50%, #0a0a0f 100%);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.legacy-gallery-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Gallery Header */
.legacy-gallery-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 24px 20px;
  background: linear-gradient(180deg, #0a0a0f 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.legacy-gallery-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: #d4af37;
  text-transform: uppercase;
  margin: 0;
}

.legacy-gallery-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 50%;
  background: transparent;
  color: rgba(212, 175, 55, 0.7);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legacy-gallery-close:hover {
  border-color: #d4af37;
  color: #d4af37;
  transform: scale(1.1);
}

/* Trace Tabs */
.legacy-tabs {
  display: flex;
  gap: 6px;
  padding: 0 20px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.legacy-tabs::-webkit-scrollbar { display: none; }

.legacy-tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #64748b;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.legacy-tab:hover { color: #94a3b8; border-color: rgba(255,255,255,0.15); }
.legacy-tab.active {
  color: #10d5ff;
  border-color: rgba(16, 158, 183, 0.4);
  background: rgba(16, 158, 183, 0.08);
}

/* Masonry Grid */
.legacy-masonry {
  padding: 0 16px 40px;
  column-count: 2;
  column-gap: 12px;
}

@media (min-width: 768px) {
  .legacy-masonry {
    column-count: 3;
    column-gap: 16px;
    padding: 0 24px 60px;
  }
}

@media (min-width: 1200px) {
  .legacy-masonry {
    column-count: 4;
    column-gap: 20px;
  }
}

/* Legacy Item */
.legacy-item {
  break-inside: avoid;
  margin-bottom: 12px;
  background: rgba(20, 20, 28, 0.8);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.15);
  transition: all 0.3s ease;
  position: relative;
}

.legacy-item:hover {
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Item with image */
.legacy-item-image {
  width: 100%;
  display: block;
  object-fit: cover;
}

/* Item content */
.legacy-item-content {
  padding: 16px;
}

.legacy-item-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
}

/* Voice indicator */
.legacy-item-voice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(212, 175, 55, 0.08);
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.legacy-voice-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0f;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.legacy-voice-icon:hover {
  transform: scale(1.1);
}

.legacy-voice-waveform {
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.legacy-voice-bar {
  width: 3px;
  background: rgba(212, 175, 55, 0.4);
  border-radius: 2px;
  transition: height 0.1s ease;
}

/* Trace badge */
.legacy-item-trace {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.8);
}

/* Empty state */
.legacy-empty {
  text-align: center;
  padding: 80px 20px;
  color: rgba(255, 255, 255, 0.4);
}

.legacy-empty-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.legacy-empty-text {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 1.2rem;
  font-style: italic;
  margin: 0;
}

/* Unseal button */
.legacy-item-unseal {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
  border: none;
  color: #0a0a0f;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legacy-item:hover .legacy-item-unseal {
  opacity: 1;
}

.legacy-item-unseal:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

/* Swipe indicator */
.legacy-swipe-hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
  color: rgba(212, 175, 55, 0.8);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  20%, 80% { opacity: 1; }
}

