@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&family=Outfit:wght@200;300;400;500;600;700;800&display=swap');

:root {
  --bg-color: #03030c;
  --primary-color: #7c3aed;
  --primary-glow: rgba(124, 58, 237, 0.5);
  --accent-color: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.5);
  --gold-color: #f59e0b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --glass-bg: rgba(10, 10, 25, 0.4);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.18);
  --shadow-color: rgba(0, 0, 0, 0.8);
  --font-display: 'Cairo', 'Outfit', sans-serif;
  --font-body: 'Cairo', 'Space Grotesk', sans-serif;
}

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

html {
  scroll-behavior: initial; /* Managed by Lenis */
  overflow-x: hidden;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
}

body {
  overflow-x: hidden;
  position: relative;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.6);
}

/* Base Layout & Interactive Elements */
a, button {
  cursor: none !important; /* Hide default cursor to force custom cursor */
}

input, textarea, select {
  cursor: none !important;
}

/* Cinematic Loading Screen */
.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #020208;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: opacity 1s cubic-bezier(0.76, 0, 0.24, 1), visibility 1s;
}

.loader-wrapper.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  position: relative;
  z-index: 10;
}

.loader-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 4rem;
  letter-spacing: 0.5rem;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--primary-color) 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUpIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.2s;
}

.loader-bar-bg {
  width: 250px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
  position: relative;
}

.loader-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transition: width 0.05s linear;
}

.loader-percentage {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  letter-spacing: 0.1rem;
}

/* Custom Cursor */
.custom-cursor {
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
  border-radius: 50%;
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.custom-cursor-glow {
  width: 40px;
  height: 40px;
  border: 1px solid var(--primary-color);
  border-radius: 50%;
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.08s ease-out, width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s;
}

/* Hover state for links */
body.hovering .custom-cursor {
  width: 24px;
  height: 24px;
  background-color: var(--primary-color);
  mix-blend-mode: normal;
  opacity: 0.8;
}

body.hovering .custom-cursor-glow {
  width: 60px;
  height: 60px;
  border-color: var(--accent-color);
  background-color: rgba(6, 182, 212, 0.1);
}

/* Mouse Glow Background effect */
.mouse-glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle 600px at var(--mouse-x, -1000px) var(--mouse-y, -1000px), rgba(124, 58, 237, 0.08), transparent 80%),
              radial-gradient(circle 300px at var(--mouse-x, -1000px) var(--mouse-y, -1000px), rgba(6, 182, 212, 0.05), transparent 70%);
}

/* Animated Grid Background */
.grid-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 50px 50px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  z-index: 0;
  pointer-events: none;
}

/* Canvas Elements (ThreeJS & Particles) */
#canvas3d-hero, #canvas3d-earth, #canvas3d-orbit, #canvas-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: auto;
}

#canvas-particles {
  z-index: 1;
  pointer-events: none;
}

#canvas3d-earth {
  position: relative;
  height: 400px;
  width: 100%;
}

/* Navigation Menu */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: padding 0.3s, background-color 0.3s;
}

header.scrolled {
  padding: 1rem 3rem;
  background-color: rgba(3, 3, 12, 0.8);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--glass-border);
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: 0.1rem;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.cta-btn-nav {
  position: relative;
  background: linear-gradient(135deg, var(--primary-color), rgba(124, 58, 237, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  font-family: var(--font-display);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.cta-btn-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.cta-btn-nav:hover::before {
  left: 100%;
}

/* Scroll Progress Bar */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 101;
  background: transparent;
}

.scroll-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  width: 0%;
}

/* General Layout helpers */
section {
  position: relative;
  padding: 8rem 6rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 5;
  overflow: hidden;
}

.section-header {
  margin-bottom: 4rem;
  max-width: 800px;
}

.section-tag {
  font-family: var(--font-display);
  color: var(--accent-color);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.3rem;
  margin-bottom: 1rem;
  display: inline-block;
  font-weight: 700;
}

.section-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.section-title span {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--primary-color) 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

@media (max-width: 992px) {
  header {
    padding: 1.5rem 1.5rem;
  }
  header.scrolled {
    padding: 1rem 1.5rem;
  }
  .nav-links {
    display: none;
  }
  section {
    padding: 6rem 2rem;
  }
  .section-title {
    font-size: 2.2rem;
  }
}

/* DKG Premium Logo & Badge Custom Styling */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  padding: 0.5rem 1.2rem;
  margin-bottom: 2rem;
  width: fit-content;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  animation: fadeUpIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-badge:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.hero-badge-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.hero-badge-text {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05rem;
  color: var(--accent-color);
}

.services-hero .hero-badge,
.museum-hero .hero-badge {
  margin-left: auto;
  margin-right: auto;
}

.loader-logo-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin: 0 auto 1.5rem auto;
  filter: drop-shadow(0 0 15px var(--primary-glow));
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUpIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  display: block;
}


/* ============================================
   MOBILE VIEWPORT OPTIMIZATIONS
   ============================================ */

/* Enable smooth scrolling on iOS */
@supports (scroll-behavior: smooth) {
  html {
    scroll-behavior: smooth;
  }
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }
  
  /* Prevent zoom on iOS */
  input, textarea, select, button {
    font-size: 16px !important;
  }
  
  /* Prevent callout menu */
  a, button {
    -webkit-touch-callout: none;
  }
}

/* SafeArea insets for notched devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  
  header {
    padding-right: max(1.5rem, env(safe-area-inset-right));
    padding-left: max(1.5rem, env(safe-area-inset-left));
  }
}
