/* 
 * Iskaira - Ice Queen of the Deep North Sea Theme
 * Main theme file with color variables, typography, and animations
 */

:root {
  /* Primary Colors */
  --color-abyssal-black: #050709; /* Deeper, near-blue black that embraces the void */
  --color-glacial-blue: #121E2A;  /* Darker navy with an icy touch */
  --color-spectral-white: rgba(216, 225, 232, 0.9); /* A cold, blue-tinted white with better contrast */
  --color-void: #030305; /* The true void for dramatic contrasts */
  
  /* Accent Colors */
  --color-bioluminescent-cyan: #00B8CC; /* For interactive elements and CTAs */
  --color-arctic-purple: #34213B; /* Adds depth and shadow */
  --color-blood-frost: #942B3B; /* Subdued crimson for danger or emphasis */
  --color-opposite-orange: #CC6B00; /* Opposite accent color for highlighted elements */
  
  /* Typography */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Space Grotesk', 'Darker Grotesque', sans-serif;
  
  /* Layout Variables */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;
  
  /* Animation Timing */
  --animation-slow: 2.5s;
  --animation-medium: 1.5s;
  --animation-fast: 0.8s;
  --animation-breath-cycle: 15s;
  --animation-freeze: 3s;
  --animation-intro: 5s;
  
  /* Border Radius */
  --radius-sharp: 0;
  --radius-slight: 2px;
  --radius-crystal: 4px 0 4px 0;
  
  /* Box Shadows */
  --shadow-inner-glow: inset 0 0 10px rgba(0, 184, 204, 0.3);
  --shadow-frost: 0 0 15px rgba(216, 225, 232, 0.15);
  --shadow-deep: 0 8px 30px rgba(10, 14, 18, 0.8);
  
  /* Z-index layers */
  --z-background: -10;
  --z-default: 1;
  --z-elevated: 10;
  --z-modal: 100;
  --z-popover: 200;
  --z-max: 999;
}

/* Base Elements */
body {
  background-color: var(--color-void);
  color: var(--color-spectral-white);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  min-height: 100vh;
  background-image: 
    linear-gradient(
      to bottom,
      var(--color-void) 0%,
      var(--color-abyssal-black) 30%,
      var(--color-glacial-blue) 85%,
      var(--color-void) 100%
    );
  background-attachment: fixed;
  text-align: center;
  position: relative;
  overflow-x: hidden;
}

/* Snow Mist Effect (After Page Load) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../assets/frost_effects/frost_effect_001.png');
  background-size: 300px 300px;
  background-repeat: repeat;
  opacity: 0.03;
  pointer-events: none;
  animation: snowDrift 120s linear infinite;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../assets/frost_effects/frost_effect_002.png');
  background-size: 500px 500px;
  background-repeat: repeat;
  opacity: 0.02;
  pointer-events: none;
  animation: snowDrift 180s linear infinite reverse;
  z-index: 0;
}

@keyframes snowDrift {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 600px 600px;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 900; /* Ultra Black */
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.85;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--color-bioluminescent-cyan);
  text-decoration: none;
  transition: all var(--animation-fast) ease-out;
  position: relative;
}

a:hover {
  color: var(--color-spectral-white);
  text-shadow: 0 0 8px var(--color-bioluminescent-cyan);
}

a:after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-bioluminescent-cyan);
  transition: width var(--animation-fast) ease-out;
}

a:hover:after {
  width: 100%;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.frost-glass {
  background: rgba(26, 44, 61, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(216, 225, 232, 0.1);
  box-shadow: var(--shadow-frost);
}

.hidden {
  display: none;
}

/* Animations */
@keyframes iceFormation {
  0% {
    opacity: 0;
    transform: scale(0.92);
    filter: blur(15px);
  }
  30% {
    opacity: 0.4;
    filter: blur(10px);
  }
  70% {
    opacity: 0.8;
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes hauntingHover {
  0% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(-7px);
  }
  70% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes frostBreath {
  0%, 100% {
    background-size: 100% 100%;
    opacity: 0.7;
  }
  50% {
    background-size: 105% 105%;
    opacity: 0.9;
  }
}

@keyframes deepDescent {
  0% {
    transform: translateY(-30px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes iceCrack {
  0% {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  }
  15% {
    clip-path: polygon(5% 0%, 100% 0%, 100% 100%, 0% 95%);
  }
  30% {
    clip-path: polygon(0% 5%, 100% 0%, 95% 100%, 0% 100%);
  }
  45% {
    clip-path: polygon(5% 0%, 95% 5%, 100% 95%, 0% 100%);
  }
  60% {
    clip-path: polygon(0% 5%, 95% 0%, 100% 100%, 5% 95%);
  }
  75% {
    clip-path: polygon(5% 5%, 100% 5%, 95% 95%, 0% 95%);
  }
  90% {
    clip-path: polygon(0% 0%, 95% 5%, 100% 95%, 5% 100%);
  }
  100% {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  }
}

/* Animation Classes */
.animate-ice-formation {
  animation: iceFormation var(--animation-slow) cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  animation-play-state: paused;
}

.animate-haunting-hover {
  animation: hauntingHover var(--animation-breath-cycle) cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.animate-frost-breath {
  animation: frostBreath var(--animation-breath-cycle) cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.animate-deep-descent {
  animation: deepDescent var(--animation-slow) cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.animate-ice-crack:hover {
  animation: iceCrack var(--animation-medium) cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes iceFreeze {
  0% {
    opacity: 0;
    transform: scale(1);
    filter: blur(0);
  }
  20% {
    opacity: 0.4;
    transform: scale(0.99);
    filter: blur(2px);
  }
  60% {
    opacity: 0.7;
    transform: scale(0.97);
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: scale(0.95);
    filter: blur(1px);
  }
}

.animate-ice-freeze {
  animation: iceFreeze var(--animation-freeze) cubic-bezier(0.22, 0.61, 0.36, 1) alternate infinite;
}

/* Responsive Breakpoints */
@media screen and (max-width: 1200px) {
  :root {
    --spacing-xl: 3rem;
  }
}

@media screen and (max-width: 768px) {
  :root {
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
}

@media screen and (max-width: 480px) {
  :root {
    --spacing-md: 0.75rem;
    --spacing-lg: 1.25rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
}