/* ============================================
   Liberation Journey - Shared Styles
   ============================================ */

:root {
  /* Physical Level - Green */
  --physical-identified: hsl(140, 70%, 35%);
  --physical-liberated: hsla(140, 60%, 75%, 0.85);
  --physical-bg: hsl(140, 20%, 15%);
  
  /* Emotional Level - Blue */
  --emotional-identified: hsl(210, 70%, 40%);
  --emotional-liberated: hsla(210, 60%, 75%, 0.85);
  --emotional-bg: hsl(210, 20%, 15%);
  
  /* Mental Level - Orange */
  --mental-identified: hsl(30, 80%, 45%);
  --mental-liberated: hsla(30, 70%, 75%, 0.85);
  --mental-bg: hsl(30, 20%, 15%);
  
  /* Causal Level - Violet */
  --causal-identified: hsl(270, 60%, 40%);
  --causal-liberated: hsla(270, 55%, 80%, 0.85);
  --causal-bg: hsl(270, 20%, 15%);
  
  /* Synthesis - Neutral with prismatic accents */
  --synthesis-bg: hsl(0, 0%, 10%);
  
  /* Typography */
  --font-primary: 'Georgia', 'Times New Roman', serif;
  --font-mono: 'Courier New', monospace;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
}

/* ============================================
   Base Styles
   ============================================ */

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

body {
  font-family: var(--font-primary);
  font-size: 18px;
  line-height: 1.6;
  color: #e0e0e0;
  overflow-x: hidden;
}

/* Level-specific backgrounds */
body.level-physical { background: var(--physical-bg); }
body.level-emotional { background: var(--emotional-bg); }
body.level-mental { background: var(--mental-bg); }
body.level-causal { background: var(--causal-bg); }
body.level-synthesis { background: var(--synthesis-bg); }

/* ============================================
   Layout Containers
   ============================================ */

.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md);
}

.intro-section {
  max-width: 800px;
  text-align: center;
  margin-bottom: var(--space-lg);
}

.intro-section h1 {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
  letter-spacing: 0.05em;
}

.intro-section h2 {
  font-size: 1.5rem;
  font-weight: 300;
  margin-bottom: var(--space-md);
  opacity: 0.8;
}

.intro-section p {
  margin-bottom: var(--space-sm);
  line-height: 1.8;
}

/* ============================================
   Puzzle Container
   ============================================ */

.puzzle-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.puzzle-area {
  position: relative;
  width: 600px;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.puzzle-svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   Progress Indicator
   ============================================ */

.progress-indicator {
  display: flex;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.progress-shape {
  width: 40px;
  height: 40px;
  opacity: 0.3;
  transition: all 0.3s ease;
}

.progress-shape.solved {
  opacity: 1;
  filter: drop-shadow(0 0 8px currentColor);
}

/* ============================================
   Portal
   ============================================ */

.portal {
  margin-top: var(--space-lg);
  text-align: center;
}

.portal-button {
  font-family: var(--font-primary);
  font-size: 1.2rem;
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  border: 2px solid currentColor;
  color: inherit;
  cursor: not-allowed;
  opacity: 0.3;
  transition: all 0.3s ease;
}

.portal-button.active {
  cursor: pointer;
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.portal-button.active:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* ============================================
   Geometric Shapes Base Classes
   ============================================ */

.shape-identified {
  fill: currentColor;
  stroke: none;
  opacity: 1;
}

.shape-liberated {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0.85;
  filter: drop-shadow(0 0 10px currentColor);
}

/* ============================================
   Iridescent Animation
   ============================================ */

@keyframes iridescent {
  0% {
    filter: hue-rotate(0deg) drop-shadow(0 0 10px currentColor);
  }
  50% {
    filter: hue-rotate(15deg) drop-shadow(0 0 15px currentColor);
  }
  100% {
    filter: hue-rotate(0deg) drop-shadow(0 0 10px currentColor);
  }
}

.shape-liberated {
  animation: iridescent 4s ease-in-out infinite;
}

/* ============================================
   3D Transforms
   ============================================ */

.perspective-container {
  perspective: 1200px;
  transform-style: preserve-3d;
}

.transform-3d {
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
}

/* ============================================
   Liberation Animation
   ============================================ */

@keyframes liberation {
  0% {
    transform: scale(1) translateZ(0);
    opacity: 1;
  }
  50% {
    transform: scale(1.3) translateZ(100px);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.5) translateZ(200px);
    opacity: 0;
  }
}

.liberating {
  animation: liberation 1.5s ease-out forwards;
}

/* ============================================
   Portal Transition Animation
   ============================================ */

@keyframes portal-open {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(2);
    opacity: 0.5;
  }
  100% {
    transform: scale(5);
    opacity: 0;
  }
}

.portal-opening {
  animation: portal-open 2s ease-out forwards;
}

/* ============================================
   Quote Display
   ============================================ */

.quote-display {
  max-width: 800px;
  margin: var(--space-md) auto;
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.05);
  border-left: 4px solid currentColor;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.quote-display.visible {
  opacity: 1;
  transform: translateY(0);
}

.quote-display .simplified {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.quote-display .source {
  font-size: 1rem;
  opacity: 0.8;
  font-style: italic;
}

/* ============================================
   Puzzle Instructions
   ============================================ */

.puzzle-instructions {
  text-align: center;
  margin-bottom: var(--space-md);
  font-size: 1.1rem;
  opacity: 0.9;
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.fade-out {
  animation: fadeOut 0.5s ease-out;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
