* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

body {
  font-family: "Inter", sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
  height: 100vh;
}

.font-playfair {
  font-family: "Playfair Display", serif;
}

.container {
  min-height: 100vh;
  background: #000;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Audio Enable Overlay */
.audio-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  animation: fadeIn 1s ease-out forwards;
}

.audio-prompt {
  text-align: center;
  animation: pulse 2s ease-in-out infinite;
}

.audio-prompt h2 {
  color: #fbbf24;
  font-size: 1.25rem;
  font-family: "Playfair Display", serif;
  margin-bottom: 0.5rem;
}

.audio-prompt p {
  color: #9ca3af;
  font-size: 0.875rem;
}

/* Hebrew Letters Background */
.hebrew-letters {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hebrew-letter {
  position: absolute;
  color: #fbbf24;
  font-size: 2rem;
  opacity: 0;
  font-family: serif;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
  animation: mysticalGlow 6s ease-in-out infinite;
}

/* Text Sequences */
.text-sequence {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  opacity: 0;
  transform: translateY(20px);
  animation: textFadeIn 1.5s ease-out forwards;
}

.text-sequence.fade-out {
  animation: textFadeOut 1.5s ease-out forwards;
}

.text-sequence h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  text-align: center;
  max-width: 90%;
  line-height: 1.4;
  font-family: "Playfair Display", serif;
}

.text-sequence em {
  font-style: italic;
  color: #fbbf24;
}

/* Book Animation */
.book-container {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-animation {
  position: relative;
  opacity: 0;
  transform: scale(0.3);
  filter: brightness(0.1) blur(10px);
  animation: bookEmerge 3.5s ease-out forwards;
}

.book-animation.opened {
  filter: brightness(1.3) blur(0px) drop-shadow(0 0 30px rgba(255, 255, 255, 0.5));
  animation: bookOpen 2s ease-out forwards, bookFloat 3s ease-in-out infinite 2s;
}

.book-image {
  width: 300px;
  height: 400px;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.book-light-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, transparent, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.4));
  border-radius: 8px;
  opacity: 0;
  animation: lightOverlay 2s ease-out forwards;
}

.book-radial-light {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0;
  animation: radialLight 2.5s ease-out forwards;
}

/* Key Animation */
.key-animation {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.2) translateY(80px);
  filter: drop-shadow(0 0 25px rgba(251, 191, 36, 0.8));
  animation: keyRise 1.8s ease-out forwards;
}

.key-animation.flying {
  animation: keyFly 1.2s ease-out forwards;
}

.key-image {
  width: 120px;
  height: 200px;
  object-fit: contain;
}

/* Flash Effects */
.flash-effect {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, white, #fef3c7, transparent);
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  animation: flashEffect 0.8s ease-in-out forwards;
}

.ripple {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 40;
  pointer-events: none;
}

.ripple-1 {
  width: 80px;
  height: 80px;
  border: 4px solid #fbbf24;
  animation: ripple1 1.2s ease-out forwards;
}

.ripple-2 {
  width: 64px;
  height: 64px;
  border: 2px solid white;
  animation: ripple2 1.5s ease-out 0.2s forwards;
}

/* Footer */
.mystical-footer {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: #9ca3af;
  font-size: 0.875rem;
  opacity: 0.6;
  font-family: "Playfair Display", serif;
  animation: pulse 3s ease-in-out infinite;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes mysticalGlow {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.8);
  }
  25% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
  75% {
    opacity: 0.4;
    transform: scale(1);
  }
}

@keyframes textFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes textFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

@keyframes bookEmerge {
  0% {
    opacity: 0;
    transform: scale(0.3);
    filter: brightness(0.1) blur(10px);
  }
  25% {
    opacity: 0.3;
    transform: scale(0.6);
    filter: brightness(0.4) blur(5px);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.8);
    filter: brightness(0.7) blur(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1) blur(0px);
  }
}

@keyframes bookOpen {
  from {
    filter: brightness(1) blur(0px);
  }
  to {
    filter: brightness(1.3) blur(0px) drop-shadow(0 0 30px rgba(255, 255, 255, 0.5));
  }
}

@keyframes bookFloat {
  0%,
  100% {
    transform: rotateY(0deg);
  }
  25% {
    transform: rotateY(3deg);
  }
  75% {
    transform: rotateY(-3deg);
  }
}

@keyframes lightOverlay {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0.5;
  }
}

@keyframes radialLight {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }
  25% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1.5);
  }
  50% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(2);
  }
  100% {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(1.8);
  }
}

@keyframes keyRise {
  0% {
    opacity: 0;
    transform: scale(0.2) translateY(80px) rotate(0deg);
  }
  50% {
    opacity: 0.8;
    transform: scale(0.6) translateY(40px) rotate(15deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0px) rotate(0deg);
  }
}

@keyframes keyFly {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0px) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.3) translateY(-80px) rotate(90deg);
  }
  100% {
    opacity: 0.8;
    transform: scale(1.8) translateY(-150px) rotate(180deg);
  }
}

@keyframes flashEffect {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes ripple1 {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(8);
  }
}

@keyframes ripple2 {
  from {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(12);
  }
}

.hidden {
  display: none;
}
.fade-out {
  animation: textFadeOut 1.5s ease-out forwards;
}
