* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Work Sans', sans-serif;
  background: radial-gradient(ellipse at center, #0a0a1a 0%, #000000 100%);
  overflow: hidden;
  --rotation-speed: 180s;
}

#cosmic-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.stars-far {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: starsDrift 240s linear infinite;
}

.stars-mid {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: starsDrift 180s linear infinite;
}

.stars-near {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: starsDrift 120s linear infinite;
}

.star {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: opacity;
}

.star-far {
  animation: twinkle 6s ease-in-out infinite;
}

.star-mid {
  animation: twinkle 4s ease-in-out infinite;
}

.star-near {
  animation: twinkle 2.618s ease-in-out infinite;
}

.stars-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.nebula-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(138, 43, 226, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(255, 140, 0, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 191, 255, 0.05) 0%, transparent 60%);
  opacity: 0.8;
  animation: nebulaPulse 30s ease-in-out infinite;
}

@keyframes starsDrift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-50px, -50px);
  }
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

@keyframes nebulaPulse {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.618);
  }
}

#vortex-container {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  overflow: hidden;
  will-change: contents, transform, filter;
  background: rgba(40, 20, 0, 0.2);
}

.spirale-container {
  animation: spin var(--rotation-speed) linear infinite;
  transform-origin: 500px 500px;
  will-change: transform;
  transform: translateZ(0);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

.spirale-blur-1 {
  filter: blur(64px);
  stroke-width: 24;
  opacity: 0.8;
}

.spirale-sharp-1 {
  filter: blur(16px);
  stroke-width: 2;
  opacity: 0.5;
}

.spirale-blur-2 {
  filter: blur(48px);
  stroke-width: 24;
  opacity: 0.8;
}

.spirale-sharp-2 {
  filter: blur(16px);
  stroke-width: 2;
  opacity: 0.5;
}

.spirale-blur-3 {
  filter: blur(64px);
  stroke-width: 32;
  opacity: 0.8;
}

.spirale-sharp-3 {
  filter: blur(16px);
  stroke-width: 2;
  opacity: 0.5;
}

.particles-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
  will-change: transform, opacity;
  animation: particleFloat 20s ease-in-out infinite, particleGlow 8s ease-in-out infinite;
}

@keyframes particleFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(15px, -20px) scale(1.1);
  }
  50% {
    transform: translate(-10px, -15px) scale(0.9);
  }
  75% {
    transform: translate(20px, -25px) scale(1.05);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes particleGlow {
  0%, 100% {
    opacity: 0.75;
  }
  50% {
    opacity: 0.95;
  }
}

@media (max-width: 768px) {
  .stars-far {
    opacity: 0.6;
  }
  
  .stars-mid {
    opacity: 0.7;
  }
  
  .stars-near {
    opacity: 0.9;
  }
  
  .nebula-layer {
    opacity: 0.3;
  }

  .spirale-blur-1,
  .spirale-blur-2,
  .spirale-blur-3 {
    stroke-width: 16 !important;
    opacity: 0.618 !important;
    filter: blur(16px) !important;
  }
  
  .spirale-sharp-1,
  .spirale-sharp-2,
  .spirale-sharp-3 {
    stroke-width: 8 !important;
    opacity: 0.618 !important;
    filter: blur(32px) !important;
  }

  .particle {
    filter: blur(2px);
  }

  #essay-container {
    width: 96% !important;
    height: 92% !important;
    padding: 1.618rem !important;
  }
  
  #essay-content {
    font-size: 1rem !important;
  }
}

@media (max-width: 480px) {

  #vortex-container {
  }

  .spirale-blur-1,
  .spirale-blur-2,
  .spirale-blur-3 {
    stroke-width: 12 !important;
    opacity: 0.618 !important;
    filter: blur(48px) !important;
  }
  
  .spirale-sharp-1,
  .spirale-sharp-2,
  .spirale-sharp-3 {
    stroke-width: 8 !important;
    opacity: 0.618 !important;
    filter: blur(16px) !important;
  }

  .particle {
    filter: blur(1px);
  }

  #essay-container {
    padding: 1rem !important;
    background: rgba(40, 20, 0, 0.8);
  }
  
  #essay-content {
    font-size: 0.85rem !important;
  }
}

#essay-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  opacity: 1;
  transition: opacity 1.618s ease-in-out;
}

#essay-overlay.essay-hidden {
  opacity: 0;
  pointer-events: none;
}

#essay-overlay.essay-visible {
  opacity: 1;
  pointer-events: auto;
}

#essay-container {
  position: relative;
  width: 96%;
  max-width: 800px;
  height: 88vh;
  background: rgba(40, 20, 0, 0.618);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(40, 20, 0, 0.8);
  padding: 1.618rem;
  overflow: hidden;
  animation: essayFadeIn 1.618s ease-out;
  backdrop-filter: blur(2px);
}

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

#essay-content {
  height: 100%;
  overflow-y: auto;
  color: rgba(255, 240, 220, 0.95);
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.618;
  text-align: left;
  padding-right: 0.8rem;
}

#essay-content::-webkit-scrollbar {
  width: 16px;
}

#essay-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

#essay-content::-webkit-scrollbar-thumb {
  background: rgba(255, 200, 100, 0.4);
  border-radius: 8px;
}

#essay-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 200, 100, 0.4);
}

#essay-content h1 {
  color: rgba(255, 220, 150, 1);
  font-size: 1.8rem;
  margin: 1.618rem 0 1rem 0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#essay-content h2 {
  color: rgba(255, 210, 140, 0.95);
  font-size: 1.618rem;
  margin: 1.3rem 0 0.8rem 0;
  font-weight: 600;
}

#essay-content h3 {
  color: rgba(255, 200, 130, 0.9);
  font-size: 1.2rem;
  margin: 1.1rem 0 0.8rem 0;
  font-weight: 600;
}

#essay-content p {
  margin: 0.8rem 0;
  text-indent: 1.5em;
}

#essay-content blockquote {
  border-left: 2px solid rgba(255, 200, 100, 0.4);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: rgba(255, 230, 200, 0.8);
  text-indent: 0;
}

#essay-content em {
  font-style: italic;
  color: rgba(255, 220, 180, 1);
}

#essay-content strong {
  font-weight: 600;
  color: rgba(255, 210, 150, 1);
}

#essay-content hr {
  border: none;
  border-top: 1px solid rgba(255, 200, 100, 0.3);
  margin: 2rem 0;
}

button {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 1rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.4s ease;
  backdrop-filter: blur(8px);
  border-radius: 8px;
}

button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.breathe-glow {
  animation: fade-in-glow 5s ease-out;
  color: #e0e0ff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.glow-last {
  animation: glow-last 5s ease-out;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes fade-in-glow {
  0% {
    opacity: 0;
    transform: scale(0.95);
    text-shadow: none;
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
  }
}

@keyframes glow-last {
  0% {
    opacity: 0.7;
    text-shadow: none;
  }
  50% {
    opacity: 1;
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.5);
  }
  100% {
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
  }
}