:root {
  --ink-black: #0A0A0A;
  --deep-black: #000000;
  --blood-red: #8B0000;
  --dark-red: #660000;
  --parchment: #F5F5DC;
  --aged-paper: #E6E6D4;
  --rust: #B7410E;
  --copper: #B87333;
  --shadow-deep: rgba(0, 0, 0, 0.8);
  --glow-red: rgba(139, 0, 0, 0.6);
  --glow-dim: rgba(139, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  font-family: 'Bad Script', cursive;
  background: var(--ink-black);
  color: var(--parchment);
  line-height: 1.4;
}

/* Atmospheric Overlay */
.atmospheric-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.flicker-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(139, 0, 0, 0.02) 50%, transparent 100%);
  animation: flicker 0.5s infinite linear; /* Reduced frequency for performance */
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.9; } /* Reduced opacity change for smoother effect */
}

.static-noise {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(139, 0, 0, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 80% 80%, rgba(139, 0, 0, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 40% 60%, rgba(139, 0, 0, 0.1) 1px, transparent 1px);
  background-size: 3px 3px, 2px 2px, 4px 4px;
  animation: static 0.3s infinite linear; /* Reduced frequency for performance */
  opacity: 0.2; /* Reduced opacity for better performance */
}

.ink-splatters {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.splatter {
  position: absolute;
  background: radial-gradient(circle, rgba(139, 0, 0, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: splatterFloat 8s ease-in-out infinite;
}

.splatter-1 {
  width: 200px;
  height: 200px;
  top: 10%;
  left: 15%;
  animation-delay: 0s;
}

.splatter-2 {
  width: 150px;
  height: 150px;
  top: 60%;
  right: 20%;
  animation-delay: 2s;
}

.splatter-3 {
  width: 100px;
  height: 100px;
  top: 80%;
  left: 30%;
  animation-delay: 4s;
}

.splatter-4 {
  width: 180px;
  height: 180px;
  top: 30%;
  right: 40%;
  animation-delay: 6s;
}

@keyframes splatterFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.1; }
  50% { transform: translate(10px, -10px) scale(1.1); opacity: 0.2; }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--deep-black);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.3s ease-out, background 0.3s ease-in-out;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-container {
  position: relative;
  width: 400px;
  height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.loading-symbol {
  width: 200px;
  height: 200px;
  animation: loadingPulse 2s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}


@keyframes codeRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.binary-code {
  animation: binaryGlow 2s ease-in-out infinite alternate;
}

@keyframes binaryGlow {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

.loading-text {
  margin-top: 30px;
  font-family: 'Special Elite', cursive;
  font-size: 24px;
  color: var(--blood-red);
  text-shadow: 0 0 10px var(--glow-red);
}

.glitch-text {
  position: relative;
  display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.glitch-text::before {
  animation: glitch1 0.5s infinite;
  color: var(--blood-red);
  z-index: -1;
}

.glitch-text::after {
  animation: glitch2 0.5s infinite;
  color: var(--dark-red);
  z-index: -2;
}

@keyframes glitch1 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

@keyframes glitch2 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(2px, -2px); }
  40% { transform: translate(2px, 2px); }
  60% { transform: translate(-2px, -2px); }
  80% { transform: translate(-2px, 2px); }
}

/* Main Archive Container */
.archive-container {
  min-height: 100vh;
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

.archive-container.visible {
  opacity: 1;
}

/* Archive Header */
.archive-header {
  padding: 40px 20px 20px;
  text-align: center;
  position: relative;
}

.header-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.ornament-line {
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blood-red), transparent);
  position: relative;
}

.ornament-line::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--glow-red), transparent);
  animation: lineGlow 0.3 s ease-in-out infinite alternate;
}

@keyframes lineGlow {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

.ornament-symbol {
  margin: 0 20px;
  font-size: 24px;
  color: var(--blood-red);
  text-shadow: 0 0 10px var(--glow-red);
  animation: symbolPulse 2s ease-in-out infinite;
}

@keyframes symbolPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.archive-title {
  font-family: 'Special Elite', cursive;
  font-size: clamp(48px, 8vw, 120px);
  font-weight: 700;
  color: var(--parchment);
  text-shadow: 
    0 0 20px var(--glow-red),
    0 0 40px var(--glow-dim);
  letter-spacing: 0.1em;
  margin: 20px 0;
  animation: titleFlicker 3s ease-in-out infinite alternate;
}

@keyframes titleFlicker {
  0% { 
    text-shadow: 0 0 20px var(--glow-red), 0 0 40px var(--glow-dim);
    opacity: 0.9;
  }
  100% { 
    text-shadow: 0 0 30px var(--glow-red), 0 0 60px var(--glow-dim);
    opacity: 1;
  }
}

.title-glitch {
  position: relative;
  display: inline-block;
}

.title-glitch::before,
.title-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.title-glitch::before {
  animation: titleGlitch1 0.8s infinite;
  color: var(--blood-red);
  z-index: -1;
}

.title-glitch::after {
  animation: titleGlitch2 0.8s infinite;
  color: var(--dark-red);
  z-index: -2;
}

@keyframes titleGlitch1 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-3px, 3px); }
  40% { transform: translate(-3px, -3px); }
  60% { transform: translate(3px, 3px); }
  80% { transform: translate(3px, -3px); }
}

@keyframes titleGlitch2 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(3px, -3px); }
  40% { transform: translate(3px, 3px); }
  60% { transform: translate(-3px, -3px); }
  80% { transform: translate(-3px, 3px); }
}

.archive-subtitle {
  font-family: 'Bad Script', cursive;
  font-size: clamp(16px, 2.5vw, 24px);
  color: var(--aged-paper);
  letter-spacing: 0.05em;
  opacity: 0.8;
}

/* Ritual Table */
.ritual-table {
  padding: 60px 80px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.table-surface {
  position: relative;
  background: 
    radial-gradient(circle at 50% 50%, rgba(139, 0, 0, 0.1) 0%, transparent 70%),
    linear-gradient(45deg, var(--ink-black) 0%, #1A1A1A 50%, var(--ink-black) 100%);
  border: 3px solid var(--blood-red);
  border-radius: 20px;
  padding: 96px;
  box-shadow: 
    0 0 50px var(--glow-red),
    inset 0 0 30px rgba(139, 0, 0, 0.2);
  display: block;
}

.table-ornaments {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.corner-ornament {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 2px solid var(--blood-red);
  border-radius: 50%;
  animation: ornamentRotate 20s linear infinite;
}

.corner-ornament::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: var(--blood-red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--glow-red);
}

.top-left { top: 20px; left: 20px; }
.top-right { top: 20px; right: 20px; }
.bottom-left { bottom: 20px; left: 20px; }
.bottom-right { bottom: 20px; right: 20px; }

@keyframes ornamentRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Card Ritual Area */
.card-ritual-area {
  position: relative;
  width: 100%;
  display: block;
}

.deck-stack {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  align-items: start;
  perspective: 1000px;
}

.deck-cards {
  position: relative;
  width: 100%;
  display: contents;
}

.project-card {
  position: relative;
  width: 100%;
  height: 340px;
  background: 
    linear-gradient(135deg, var(--ink-black) 0%, #1A1A1A 50%, var(--ink-black) 100%);
  border: 2px solid var(--blood-red);
  border-radius: 15px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 0 20px var(--glow-red),
    inset 0 0 20px rgba(139, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  transform-style: preserve-3d;
  animation: cardRise 0.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
  transform: translateY(100px) rotateX(45deg) scale(0.8);
  flex-shrink: 0;
  will-change: transform, opacity; /* Optimize for animations */
  contain: layout style paint; /* CSS containment for better performance */
}

.project-card:nth-child(1) { animation-delay: 0.2s; z-index: 6; }
.project-card:nth-child(2) { animation-delay: 0.4s; z-index: 5; }
.project-card:nth-child(3) { animation-delay: 0.6s; z-index: 4; }
.project-card:nth-child(4) { animation-delay: 0.8s; z-index: 3; }
.project-card:nth-child(5) { animation-delay: 1.0s; z-index: 2; }
.project-card:nth-child(6) { animation-delay: 1.2s; z-index: 1; }

/* Ensure cards are visible after animation */
.project-card.animated {
  opacity: 1;
  transform: translateY(0) rotateX(0deg) scale(1);
  pointer-events: auto;
}

@keyframes cardRise {
  0% {
    opacity: 0;
    transform: translateY(100px) rotateX(45deg) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
  }
}

/* .project-card:hover {
  transform: translateY(-20px) rotateX(5deg) scale(1.05);
  box-shadow: 
    0 0 40px var(--glow-red),
    0 0 80px var(--glow-dim),
    inset 0 0 30px rgba(139, 0, 0, 0.2);
  border-color: var(--parchment);
  z-index: 10;
} */

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(45deg, transparent, rgba(139, 0, 0, 0.1), transparent);
  border-radius: 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover::before {
  opacity: 1;
}

.card-image {
  width: 100%;
  height: 140px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid var(--blood-red);
  filter: sepia(20%) contrast(1.1);
  transition: filter 0.1s ease;
  background: rgba(139, 0, 0, 0.1);
}

.project-card:hover .card-image {
  filter: sepia(0%) contrast(1.2);
}

.card-title {
  font-family: 'Special Elite', cursive;
  font-size: 16px;
  font-weight: 700;
  color: var(--parchment);
  margin-bottom: 10px;
  text-shadow: 0 0 5px var(--glow-red);
  text-align: center;
}

.card-short-description {
  font-family: 'Bad Script', cursive;
  font-size: 12px;
  color: var(--aged-paper);
  line-height: 1.3;
  text-align: center;
  opacity: 0.8;
}

/* Ritual Circle */
.ritual-circle-table {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  opacity: 0.3;
  animation: circlePulse 4s ease-in-out infinite;
}

@keyframes circlePulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.05); }
}

.circle-svg {
  width: 100%;
  height: 100%;
  animation: circleRotate 30s linear infinite;
}

@keyframes circleRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Project Ritual */
.project-ritual {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 20px;
}

.project-ritual.visible {
  opacity: 1;
  visibility: visible;
}

/* Close button */
.ritual-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--blood-red);
  background: rgba(139, 0, 0, 0.15);
  color: var(--parchment);
  font-family: 'Special Elite', cursive;
  font-size: 18px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 0 12px var(--glow-red);
  z-index: 1001;
}

.ritual-close:hover {
  background: rgba(139, 0, 0, 0.3);
  transform: translateY(-1px);
}

.ritual-chamber {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1200px;
  width: 90%;
  margin: 40px auto;
  min-height: calc(100vh - 80px);
}

.chamber-left {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ritual-card {
  width: 100%;
  max-width: 500px;
  animation: ritualReveal 1s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ritualReveal {
  0% {
    opacity: 0;
    transform: translateX(-50px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.card-frame {
  position: relative;
  background: 
    linear-gradient(135deg, var(--ink-black) 0%, #1A1A1A 50%, var(--ink-black) 100%);
  border: 3px solid var(--blood-red);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 
    0 0 50px var(--glow-red),
    inset 0 0 30px rgba(139, 0, 0, 0.2);
}

.card-border {
  position: relative;
  border: 1px solid var(--parchment);
  border-radius: 15px;
  padding: 20px;
}

.card-image-container {
  position: relative;
  margin-bottom: 20px;
}

.ritual-card .card-image {
  height: 200px;
  border-radius: 10px;
  filter: sepia(10%) contrast(1.1);
  object-fit: contain;
  background: rgba(139, 0, 0, 0.1);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 10px;
  overflow: hidden;
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(139, 0, 0, 0.1), transparent);
  animation: glowSweep 3s ease-in-out infinite;
}

@keyframes glowSweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.card-content {
  text-align: center;
}

.ritual-card .card-title {
  font-size: 24px;
  margin-bottom: 15px;
}

.card-divider {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blood-red), transparent);
  margin: 15px 0;
}

.ritual-card .card-description {
  font-size: 16px;
  color: var(--aged-paper);
  line-height: 1.5;
}

.chamber-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lore-panel {
  max-width: 500px;
  animation: loreReveal 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

@keyframes loreReveal {
  0% {
    opacity: 0;
    transform: translateX(50px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.lore-header {
  margin-bottom: 30px;
}

.lore-title {
  font-family: 'Special Elite', cursive;
  font-size: clamp(28px, 4vw, 36px);
  color: var(--blood-red);
  text-shadow: 0 0 15px var(--glow-red);
  margin-bottom: 15px;
  animation: loreGlow 2s ease-in-out infinite alternate;
}

@keyframes loreGlow {
  0% { text-shadow: 0 0 15px var(--glow-red); }
  100% { text-shadow: 0 0 25px var(--glow-red), 0 0 35px var(--glow-dim); }
}

.lore-divider {
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--blood-red), transparent);
  position: relative;
}

.lore-divider::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, transparent, var(--glow-red), transparent);
  animation: dividerGlow 2s ease-in-out infinite alternate;
}

@keyframes dividerGlow {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

.lore-description {
  font-family: 'Bad Script', cursive;
  font-size: 18px;
  color: var(--parchment);
  line-height: 1.6;
  margin-bottom: 30px;
  text-align: justify;
}

.lore-actions {
  position: relative;
}

.ritual-button {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 40px;
  background: 
    linear-gradient(135deg, var(--blood-red), var(--dark-red));
  color: var(--parchment);
  border: 2px solid var(--parchment);
  border-radius: 50px;
  font-family: 'Special Elite', cursive;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 0 20px var(--glow-red),
    inset 0 0 20px rgba(139, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.ritual-button:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 0 30px var(--glow-red),
    0 0 50px var(--glow-dim),
    inset 0 0 30px rgba(139, 0, 0, 0.4);
  color: var(--parchment);
  text-decoration: none;
}

.ritual-button:visited {
  color: var(--parchment);
  text-decoration: none;
}

.ritual-button.disabled {
  background: linear-gradient(135deg, #666, #444);
  color: #999;
  cursor: not-allowed;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.ritual-button.disabled:hover {
  transform: none;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.button-rune {
  font-size: 20px;
  animation: runeSpin 2s linear infinite;
}

@keyframes runeSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ritual-button.disabled .button-rune {
  animation: none;
}

/* Tooltip */
.ritual-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: var(--parchment);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.1s ease;
  z-index: 10;
  border: 1px solid var(--blood-red);
  box-shadow: 0 0 15px var(--glow-red);
}

.ritual-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}

.ritual-button.disabled:hover + .ritual-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Navigation */
.archive-nav {
  position: fixed;
  top: 30px;
  left: 30px;
  z-index: 100;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 25px;
  background: rgba(139, 0, 0, 0.1);
  border: 2px solid var(--blood-red);
  border-radius: 50px;
  color: var(--parchment);
  text-decoration: none;
  font-family: 'Special Elite', cursive;
  font-weight: 700;
  transition: all 0.1s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 15px var(--glow-red);
}

.nav-link:hover {
  background: rgba(139, 0, 0, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--glow-red);
}

.nav-icon {
  font-size: 20px;
  transition: transform 0.1s ease;
}

.nav-link:hover .nav-icon {
  transform: translateX(-3px);
}

/* Atmospheric Effects */
.atmospheric-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.candle-flicker {
  position: absolute;
  top: 20%;
  left: 10%;
  width: 4px;
  height: 4px;
  background: var(--blood-red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--glow-red);
  animation: candleFlicker 0.3s ease-in-out infinite;
}

@keyframes candleFlicker {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.shadow-play {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 70%, rgba(139, 0, 0, 0.1) 0%, transparent 50%);
  animation: shadowMove 8s ease-in-out infinite;
}

@keyframes shadowMove {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.1); }
}

.whisper-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Bad Script', cursive;
  font-size: 14px;
  color: var(--aged-paper);
  opacity: 0.3;
  animation: whisperFade 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes whisperFade {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Enhanced Controls */
.archive-controls {
  margin: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  will-change: transform; /* Optimize for animations */
}

.search-container {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 15px 50px 15px 20px;
  background: rgba(139, 0, 0, 0.1);
  border: 2px solid var(--blood-red);
  border-radius: 50px;
  color: var(--parchment);
  font-family: 'Bad Script', cursive;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.search-input:focus {
  border-color: var(--parchment);
  box-shadow: 0 0 20px var(--glow-red);
  background: rgba(139, 0, 0, 0.2);
}

.search-input::placeholder {
  color: var(--aged-paper);
  opacity: 0.7;
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--blood-red);
  pointer-events: none;
}

.filter-container {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-button {
  padding: 12px 24px;
  background: rgba(139, 0, 0, 0.1);
  border: 2px solid var(--blood-red);
  border-radius: 25px;
  color: var(--parchment);
  font-family: 'Special Elite', cursive;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.filter-button:hover {
  background: rgba(139, 0, 0, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--glow-red);
}

.filter-button.active {
  background: var(--blood-red);
  color: var(--parchment);
  box-shadow: 0 0 20px var(--glow-red);
}


/* Enhanced Card Styles */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.card-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

.status-active {
  background: #00ff00;
  box-shadow: 0 0 10px #00ff00;
}

.status-development {
  background: #ffaa00;
  box-shadow: 0 0 10px #ffaa00;
}

.status-ongoing {
  background: #0088ff;
  box-shadow: 0 0 10px #0088ff;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.card-ecosystem {
  font-family: 'Special Elite', cursive;
  font-size: 10px;
  color: var(--blood-red);
  background: rgba(139, 0, 0, 0.2);
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--blood-red);
}

.card-technologies {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0;
}

.tech-tag {
  font-size: 10px;
  background: rgba(139, 0, 0, 0.3);
  color: var(--aged-paper);
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--blood-red);
}

.card-stats {
  margin-top: 10px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  margin: 2px 0;
}

.stat-label {
  color: var(--aged-paper);
  opacity: 0.8;
}

.stat-value {
  color: var(--parchment);
  font-weight: 700;
}

/* Enhanced Project Details */
.project-details {
  margin: 30px 0;
}

.detail-section {
  margin-bottom: 25px;
}

.detail-title {
  font-family: 'Special Elite', cursive;
  font-size: 18px;
  color: var(--blood-red);
  margin-bottom: 15px;
  text-shadow: 0 0 10px var(--glow-red);
}

.tech-badge {
  display: inline-block;
  background: rgba(139, 0, 0, 0.3);
  color: var(--parchment);
  padding: 8px 16px;
  margin: 5px;
  border-radius: 20px;
  border: 1px solid var(--blood-red);
  font-size: 14px;
  transition: all 0.3s ease;
}

.tech-badge:hover {
  background: var(--blood-red);
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--glow-red);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.stat-item {
  background: rgba(139, 0, 0, 0.1);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid var(--blood-red);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: rgba(139, 0, 0, 0.2);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 12px;
  color: var(--aged-paper);
  opacity: 0.8;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 18px;
  color: var(--parchment);
  font-weight: 700;
  text-shadow: 0 0 5px var(--glow-red);
}


.related-projects {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.related-project {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--blood-red);
  background: rgba(139, 0, 0, 0.1);
}

.related-project:hover {
  background: rgba(139, 0, 0, 0.2);
  transform: scale(1.05);
}

.related-project img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  margin-bottom: 5px;
  border: 1px solid var(--blood-red);
}

.related-project span {
  font-size: 12px;
  color: var(--aged-paper);
  text-align: center;
}

/* Card Transition Animations */
@keyframes cardFadeOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8); }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .ritual-chamber {
    grid-template-columns: 1fr;
    gap: 40px;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .chamber-left {
    order: 2;
  }
  
  .chamber-right {
    order: 1;
  }
}

@media (max-width: 768px) {
  .table-surface {
    padding: 20px;
  }
  
  .project-card {
    width: 200px;
    height: 320px;
    padding: 15px;
  }
  
  .card-image {
    height: 100px;
  }
  
  .archive-title {
    font-size: clamp(36px, 10vw, 80px);
  }
  
  .nav-link {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  .archive-controls {
    margin: 20px 0;
    gap: 20px;
  }
  
  .search-container {
    max-width: 300px;
  }
  
  .filter-container {
    gap: 10px;
  }
  
  .filter-button {
    padding: 10px 16px;
    font-size: 12px;
  }
  
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .related-projects {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .project-card {
    width: 180px;
    height: 300px;
    padding: 12px;
  }
  
  .card-image {
    height: 80px;
  }
  
  .card-title {
    font-size: 14px;
  }
  
  .card-short-description {
    font-size: 10px;
  }
  
  .archive-controls {
    margin: 15px 0;
    gap: 15px;
  }
  
  .search-container {
    max-width: 250px;
  }
  
  .search-input {
    padding: 12px 40px 12px 15px;
    font-size: 14px;
  }
  
  .filter-container {
    gap: 8px;
  }
  
  .filter-button {
    padding: 8px 12px;
    font-size: 11px;
  }
  
  
  .tech-badge {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .stat-item {
    padding: 10px;
  }
  
  .stat-value {
    font-size: 16px;
  }
}