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

:root {
  --space-charcoal: #11131A;
  --mars-red: #FF3B3B;
  --mars-red-glow: rgba(255, 59, 59, 0.4);
  --lunar-white: #F0F2F5;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --glass-bg: rgba(240, 242, 245, 0.03);
  --glass-border: rgba(240, 242, 245, 0.08);
  --glass-specular: rgba(255, 255, 255, 0.12);
  --max-reading-width: 75ch;
  --mouse-x: 50%;
  --mouse-y: 50%;
}

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

body {
  background-color: var(--space-charcoal);
  color: var(--lunar-white);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

main, footer, nav, section {
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  body, a, button, .dropdown { cursor: none !important; }
}

.custom-cursor {
  width: 12px; height: 12px;
  background: var(--mars-red);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s, border 0.2s;
}
.custom-cursor.active {
  width: 50px; height: 50px;
  background: rgba(255, 59, 59, 0.1);
  border: 1px solid var(--mars-red);
}

.film-grain {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none; z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.preloader {
  position: fixed; inset: 0;
  background-color: var(--space-charcoal);
  display: flex; justify-content: center; align-items: center;
  z-index: 10000; font-family: var(--font-display);
  font-size: 2rem; letter-spacing: 0.1em; color: var(--mars-red);
}

h1, h2, h3, .display-font { font-family: var(--font-display); letter-spacing: -0.02em; font-weight: 700; }
p { max-width: var(--max-reading-width); margin-bottom: 1rem; font-size: 1.1rem; color: rgba(240, 242, 245, 0.85); }
a { color: var(--lunar-white); text-decoration: none; }

.container { width: 90%; max-width: 1280px; margin: 0 auto; }
section { padding: 5rem 0; position: relative; }
.page-header { padding-top: 10rem; padding-bottom: 3rem; }

nav {
  position: fixed; top: 2rem; left: 50%; transform: translateX(-50%);
  width: 90%; max-width: 1280px; display: flex; justify-content: space-between; align-items: center;
  z-index: 1000; padding: 1rem 2rem; background: var(--glass-bg);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border); border-top: 1px solid var(--glass-specular);
  border-radius: 100px;
}

.logo { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.logo-icon { 
  width: 10px; height: 10px; background: var(--mars-red); border-radius: 50%; 
  box-shadow: 0 0 15px var(--mars-red-glow); 
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.logo-icon.dynamic-white {
  background: var(--lunar-white) !important;
  box-shadow: 0 0 15px rgba(240, 242, 245, 0.6) !important;
}

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a, .dropdown { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; transition: color 0.3s ease; }
.nav-links a:hover, .dropdown:hover > a { color: var(--mars-red); }

.dropdown { position: relative; display: inline-block; padding: 0.5rem 0; }
.dropdown-content {
  display: flex; flex-direction: column; opacity: 0; pointer-events: none;
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px);
  background: rgba(17, 19, 26, 0.9); border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px); border-radius: 12px; padding: 0.5rem 0; min-width: 180px;
  transition: all 0.3s ease; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.dropdown:hover .dropdown-content { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.dropdown-content a { padding: 0.75rem 1.5rem; color: var(--lunar-white); display: block; border-left: 2px solid transparent; }
.dropdown-content a:hover { background: rgba(255, 59, 59, 0.05); color: var(--mars-red); border-left-color: var(--mars-red); }

.btn-primary {
  background: var(--mars-red); color: var(--lunar-white); padding: 0.65rem 1.5rem;
  border-radius: 100px; font-family: var(--font-display); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; border: none; outline: none;
  display: inline-flex; justify-content: center; align-items: center;
  box-shadow: 0 0 20px rgba(255, 59, 59, 0.2); transition: box-shadow 0.3s ease;
}
.btn-primary:hover { box-shadow: 0 0 30px rgba(255, 59, 59, 0.4); }

.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; position: relative; padding-top: 8rem; }
.hero h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: 1.1; text-transform: uppercase; margin-bottom: 1.5rem; }
.span-red, .tagline, .glass-card i, [style*="color: var(--mars-red)"] { transition: color 0.4s ease, text-shadow 0.4s ease; }
.span-red { color: var(--mars-red); }
.dynamic-white {
  color: var(--lunar-white) !important;
  text-shadow: 0 0 12px rgba(240, 242, 245, 0.5) !important;
}
.hero .tagline { font-size: 1.25rem; color: var(--mars-red); font-family: var(--font-display); margin-bottom: 2rem; letter-spacing: 0.05em; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; margin-top: 3rem; }
.glass-card {
  background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05); border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px; padding: 2.5rem 2rem; position: relative; overflow: hidden;
  transform-style: preserve-3d;
}
.glass-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle 400px at var(--mouse-x) var(--mouse-y), rgba(255, 59, 59, 0.08), transparent 80%);
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.glass-card:hover::before { opacity: 1; }
.glass-card:hover { border-color: rgba(255, 59, 59, 0.2); }
.glass-card h3 { font-size: 1.3rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.8rem; transform: translateZ(20px); }
.glass-card p { transform: translateZ(10px); }
.glass-card ul { transform: translateZ(10px); }
.glass-card i { color: var(--mars-red); font-size: 1.8rem; }

/* Dual-Canvas Background Injection */
.ambient-glow {
  position: absolute; top: -20%; left: -10%;
  width: 70vw; height: 70vw;
  background: radial-gradient(circle, rgba(255, 59, 59, 0.08) 0%, transparent 60%);
  pointer-events: none; z-index: 0; border-radius: 50%;
}
.canvas-container {
  position: fixed; inset: 0;
  z-index: -999;
  background-color: var(--space-charcoal);
  pointer-events: none;
}
.canvas-container canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%; display: block;
}
#shader-canvas { z-index: 1; }
#thermo-canvas { z-index: 2; pointer-events: none; }
.gradient-fade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--space-charcoal) 5%, transparent 40%);
  pointer-events: none; z-index: 3;
}

footer { border-top: 1px solid var(--glass-border); padding: 3rem 0; margin-top: 4rem; text-align: center; font-size: 0.9rem; color: rgba(240, 242, 245, 0.5); }

.char { display: inline-block; }
.word { display: inline-block; overflow: hidden; vertical-align: bottom; }

.hamburger-btn {
  display: none; flex-direction: column; justify-content: space-between;
  width: 24px; height: 18px; cursor: pointer; z-index: 1001;
}
.hamburger-btn span {
  display: block; width: 100%; height: 2px;
  background-color: var(--lunar-white);
  transition: all 0.3s ease; transform-origin: left;
}
.hamburger-btn.active span:nth-child(1) { transform: rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg); }

@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; justify-content: space-between; align-items: center; border-radius: 0; border: none; background: transparent; backdrop-filter: none; box-shadow: none; top: 0; width: 100%; }
  .hamburger-btn { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: 0; width: 100%; height: 100vh;
    background: rgba(17, 19, 26, 0.95); backdrop-filter: blur(20px);
    flex-direction: column; justify-content: center; align-items: center; gap: 3rem;
    transform: translateY(-100%); transition: transform 0.6s cubic-bezier(0.8, 0, 0.2, 1);
    z-index: 1000; display: flex !important;
  }
  .nav-links.active { transform: translateY(0); }
  .nav-links a { font-size: 1.5rem; border-left: none; }
  .dropdown > a { font-size: 1.5rem; display: inline-block; }
  .dropdown-content, .dropdown:hover .dropdown-content, .dropdown.active .dropdown-content {
    position: static !important; opacity: 1 !important; visibility: visible !important; 
    transform: none !important; background: transparent !important; border: none !important; 
    padding: 1rem 0 0 0 !important; text-align: center !important; box-shadow: none !important; pointer-events: auto !important;
  }
  .dropdown-content { display: none !important; }
  .dropdown.active .dropdown-content { display: flex !important; flex-direction: column; gap: 1rem; }
  .dropdown-content a { font-size: 1.2rem; padding: 0.5rem; }
  .btn-primary { width: auto; font-size: 1.2rem; margin-top: 1rem; }
}
