/* ==========================================================================
   XENOVARIA - Grimdark Chaos & Molten Nether Core Design System
   "Forged in Chaos, Cloaked in Lore"
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;900&family=Rajdhani:wght@500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* Molten Nether Palette */
  --color-void: #06070a;
  --color-basalt-deep: #0b0d13;
  --color-basalt-surface: #12151e;
  --color-basalt-elevated: #1a1e2b;
  --color-basalt-border: #262c3d;
  --color-basalt-border-highlight: #3c4560;

  /* Chaos Energy / Magma Core Accents */
  --color-amber-core: #ff5400;
  --color-amber-glow: #ff7700;
  --color-amber-flare: #ffa200;
  --color-crimson-nether: #d90429;
  --color-crimson-glow: #ef233c;
  --color-gold-rune: #e0a96d;
  --color-gold-bright: #ffd166;
  --color-alien-cyan: #06d6a0;

  /* Typography Colors */
  --text-primary: #f0f3fa;
  --text-secondary: #9aa5be;
  --text-muted: #626c85;
  --text-accent: #ff9100;
  --text-rune: #d4af37;

  /* Gradients */
  --grad-molten: linear-gradient(135deg, #ff5400 0%, #ef233c 100%);
  --grad-molten-hover: linear-gradient(135deg, #ffa200 0%, #ff5400 100%);
  --grad-basalt-card: linear-gradient(180deg, rgba(26, 30, 43, 0.85) 0%, rgba(14, 17, 24, 0.95) 100%);
  --grad-hero-overlay: radial-gradient(circle at 50% 30%, rgba(255, 84, 0, 0.15) 0%, rgba(6, 7, 10, 0.95) 75%);

  /* Typography Fonts */
  --font-heading: 'Cinzel', Georgia, serif;
  --font-hud: 'Rajdhani', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows & Glows */
  --glow-amber: 0 0 25px rgba(255, 84, 0, 0.45);
  --glow-crimson: 0 0 25px rgba(239, 35, 60, 0.45);
  --glow-subtle: 0 4px 20px rgba(0, 0, 0, 0.7);
  --box-shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.8), 0 0 1px 1px rgba(255, 84, 0, 0.15);

  /* Layout */
  --container-max-width: 1200px;
  --nav-height: 80px;
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--color-void);
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--color-void);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Canvas & Ambient Layer */
#ember-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

.ambient-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 10%, rgba(255, 84, 0, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 80% 80%, rgba(217, 4, 41, 0.05) 0%, transparent 50%);
}

/* Main App Shell Layout */
#app-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography Hierarchy */
h1, h2, h3, h4, .brand-title {
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.15;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.4rem;
  line-height: 1.3;
}

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

a {
  color: var(--color-amber-flare);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: #fff;
  text-shadow: 0 0 10px var(--color-amber-glow);
}

/* Header & Navigation Bar */
.site-header {
  position: sticky;
  top: 0;
  height: var(--nav-height);
  background: rgba(6, 7, 10, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 84, 0, 0.2);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: var(--transition-smooth);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-sigil {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 10px rgba(255, 84, 0, 0.6));
  animation: pulse-sigil 3.5s infinite ease-in-out;
}

@keyframes pulse-sigil {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 84, 0, 0.5)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 18px rgba(255, 120, 0, 0.85)); transform: scale(1.03); }
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, #ffffff 40%, #ff8c42 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.brand-subtext {
  font-family: var(--font-hud);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--color-gold-rune);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  font-family: var(--font-hud);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0;
  transition: var(--transition-smooth);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--grad-molten);
  box-shadow: 0 0 8px var(--color-amber-glow);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 84, 0, 0.5);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-basalt-border);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

/* Page Transition Wrapper for SPA */
#page-content {
  flex: 1;
  position: relative;
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#page-content.view-fade-out {
  opacity: 0;
  transform: translateY(8px);
}

#page-content.view-fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Footer Section */
.site-footer {
  margin-top: auto;
  background: #050608;
  border-top: 1px solid rgba(255, 84, 0, 0.15);
  padding: 3.5rem 0 2rem 0;
  position: relative;
  z-index: 10;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  font-family: var(--font-hud);
  font-size: 1.15rem;
  letter-spacing: 0.15em;
  color: var(--color-gold-bright);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-col p {
  font-size: 0.95rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-links a:hover {
  color: var(--color-amber-flare);
  transform: translateX(4px);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-hud);
  letter-spacing: 0.05em;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: rgba(6, 7, 10, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 84, 0, 0.25);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
