/* 
  ⚔️ VOTAN - NORDIC TECH THEME ⚔️
  Pure CSS Variables & Utilities
*/

:root {
  /* Branding Colors */
  --color-void-black: #0f172a;
  /* Deep Slate / Void */
  --color-void-dark: #020617;
  /* Almost Black */
  --color-glacial-cyan: #22d3ee;
  /* Primary Action / Glow */
  --color-glacial-dim: #0891b2;
  /* Muted Cyan */
  --color-mythic-gold: #d97706;
  /* Accents / Royal */
  --color-mist-gray: #94a3b8;
  /* Text Secondary */
  --color-pure-white: #f8fafc;
  /* Text Primary */

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Typography */
  --font-heading: 'Cinzel', serif;
  --font-body: 'Inter', sans-serif;
  /* Glass / Nordic Effects */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: 1px solid rgba(34, 211, 238, 0.2);
  --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  --glass-blur: blur(12px);
}

#rune-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Base Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--color-void-black);
  /* Fixes white gap on mobile overscroll */
  height: 100%;
}

body {
  /* Transparent to let rune canvas show through uniformly */
  background: transparent;
  min-height: 100vh;
  color: var(--color-pure-white);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Fallback for non-HTML5/JS environments */
body.static-bg {
  background-image: url('/assets/images/runes_bg.png');
  background-repeat: repeat;
  background-blend-mode: overlay;
  background-size: 500px;
}

/* Typography Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-pure-white);
  line-height: 1.2;
}

.text-cyan {
  color: var(--color-glacial-cyan);
}

.text-gold {
  color: var(--color-mythic-gold);
}

.text-mist {
  color: var(--color-mist-gray);
}

/* Layout Utilities (Flex/Grid) */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.hero-section {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-xl) 0;
  /* background handled by body for transparency/layers */
}

.grid-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* Components: Cards (Nordic Glass) */
.card {
  border: var(--glass-border);
  padding: var(--space-md);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

/* Card backdrop on pseudo-element to allow mix-blend-mode on children */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  z-index: -1;
  border-radius: 12px;
}

/* Subtle shine effect on top border */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.5), transparent);
  opacity: 0.5;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--color-glacial-cyan);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.2);
}

/* Components: Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

/* Header Glass */
.site-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* Header backdrop on pseudo-element to allow mix-blend-mode on children */
.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.3);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: -1;
}

.btn-primary {
  background: rgba(34, 211, 238, 0.05);
  /* Subtle glass tint */
  border: 1px solid var(--color-glacial-cyan);
  color: var(--color-glacial-cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.1);
  backdrop-filter: blur(4px);
}

.btn-primary:hover {
  background: rgba(34, 211, 238, 0.25);
  /* Transparent hover */
  color: var(--color-pure-white);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.4);
  border-color: var(--color-pure-white);
}

.btn-gold {
  border: 2px solid var(--color-mythic-gold);
  color: var(--color-mythic-gold);
}

.btn-gold:hover {
  background: var(--color-mythic-gold);
  color: var(--color-void-black);
}

/* Responsive/Mobile Styles */
/* Utils for Nav */
.btn-nav {
  color: white;
  font-size: 0.9rem;
}

.btn-lang {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  padding: 0.5rem 1.5rem;
  background: transparent;
  border: 1px solid rgba(34, 211, 238, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
}

.lang-switcher {
  margin-left: 1rem;
  position: relative;
  display: inline-block;
}

#lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 4px;
  z-index: 1000;
  min-width: 120px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#lang-dropdown a {
  display: block;
  padding: 10px 15px;
  color: white;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

#mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  /* Must be higher than nav overlay (1000) */
}

#mobile-menu-toggle .bar {
  display: block;
  width: 25px;
  height: 2px;
  margin: 5px auto;
  background-color: white;
  transition: all 0.3s ease-in-out;
}

/* Animations for Hamburger */
#mobile-menu-toggle.active .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

#mobile-menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

#mobile-menu-toggle.active .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Responsive/Mobile Styles */
@media (max-width: 768px) {
  :root {
    --space-xl: 4rem;
    --space-md: 1.5rem;
  }

  /* UNSTICK HEADER ON MOBILE but KEEP STACKING CONTEXT */
  .site-header {
    position: relative !important;
    /* Unstuck but allows z-index */
    width: 100%;
    /* Ensure full viewport width for absolute positioning */
    background: transparent;
    border-bottom: none;
    padding: 1.5rem;
    z-index: 2000;
    /* Ensure header and its nav children are above everything */
  }

  /* HEADER TEXT - RESET IF NEEDED */
  .site-header .logo {
    z-index: 200;
    position: relative;
  }

  h1 {
    font-size: 2rem !important;
  }

  h2 {
    font-size: 1.5rem !important;
  }

  .hero-section {
    padding: var(--space-lg) 0;
    min-height: auto;
  }

  .container {
    padding: 0 1.5rem;
  }

  .site-header {
    position: relative;
    /* For absolute child positioning */
  }

  #mobile-menu-toggle {
    display: block;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
  }

  #main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(2, 6, 23, 0.98);
    /* VOID DARK */
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
  }

  #main-nav.active {
    transform: translateY(0);
  }

  /* Reset margin for mobile nav items */
  #main-nav a,
  #main-nav .btn,
  #main-nav span {
    margin: 0 !important;
    font-size: 1.25rem !important;
  }

  /* WRAPPERS (Auth/Guest Spans) - RESET LAYOUT */
  #main-nav>span {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    gap: 1.5rem;
    /* Match parent gap */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    /* No animation on wrapper */
    opacity: 1 !important;
  }

  /* NORDIC GOD TIER TYPOGRAPHY - ENFORCE UNIFORMITY */
  #main-nav a,
  #main-nav button,
  #main-nav .btn,
  #main-nav .lang-switcher {
    font-family: var(--font-heading);
    font-size: 1.4rem !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-pure-white);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;

    /* GLASS SLAB BASE STYLES - STRICT ENFORCEMENT */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 85% !important;
    max-width: 350px !important;
    height: 70px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(34, 211, 238, 0.05) !important;
    border: 1px solid rgba(34, 211, 238, 0.2) !important;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.05) !important;
    border-radius: 4px !important;
    text-decoration: none !important;
  }

  /* BUTTON OVERRIDES - Remove inner styles */
  #main-nav .btn {
    background: rgba(34, 211, 238, 0.05) !important;
    /* Re-apply slab bg */
  }

  /* HOVER EFFECTS - UNIFIED */
  #main-nav a:hover,
  #main-nav button:hover,
  #main-nav .btn:hover,
  #main-nav .lang-switcher:hover {
    background: rgba(34, 211, 238, 0.15) !important;
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.2) !important;
    border-color: rgba(34, 211, 238, 0.6) !important;
    letter-spacing: 3px;
    transform: translateY(-2px);
    cursor: pointer;
  }

  /* EXCEPTION: Lang Switcher internals */
  #main-nav .lang-switcher {
    flex-direction: column !important;
    /* Keep dropdown vertical */
    height: auto !important;
    /* Allow expansion */
    min-height: 70px !important;
    position: relative;
    padding: 0 !important;
    /* Reset padding */
    margin-top: 1rem !important;
    background: transparent !important;
    /* Wrapper is transparent */
    border: none !important;
    box-shadow: none !important;
  }

  /* Lang Button is the real slab */
  #main-nav .lang-switcher .btn-lang {
    width: 100% !important;
    height: 70px !important;
    background: rgba(34, 211, 238, 0.05) !important;
    border: 1px solid rgba(34, 211, 238, 0.2) !important;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.05) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  /* ACTIVE STATE ANIMATIONS - TARGET ALL */
  #main-nav.active a,
  #main-nav.active button,
  #main-nav.active div {
    animation: fadeSlideIn 0.5s forwards;
  }

  /* STAGGER DELAYS (Re-flattened) */
  /* Main Links */
  #main-nav.active>a:nth-child(1) {
    animation-delay: 0.1s;
  }

  #main-nav.active>a:nth-child(2) {
    animation-delay: 0.2s;
  }

  /* Guest Wrapper Items */
  #main-nav.active>span>a:nth-child(1) {
    animation-delay: 0.3s;
  }

  #main-nav.active>span>a:nth-child(2) {
    animation-delay: 0.4s;
  }

  /* Lang Switcher */
  #main-nav.active .lang-switcher {
    animation-delay: 0.5s;
  }

  @keyframes fadeSlideIn {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Lang switcher specific adaptations */
  .lang-switcher {
    /* Slab styles inherited above */
    flex-direction: column;
    /* Dropdown logic */
    position: relative;
    margin-top: 1rem;
  }

  .btn-lang {
    width: 100%;
    height: 100%;
    justify-content: center;
    border: none;
    font-size: 1.2rem;
  }

  #lang-dropdown {
    top: auto;
    bottom: 100%;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    min-width: 150px;
    text-align: center;
    background: rgba(2, 6, 23, 0.95);
    border: 1px solid rgba(34, 211, 238, 0.2);
  }
}