/* --- CSS Reset & Variables --- */
:root {
  --bg-color: #05070e;
  /* Extremely dark blue/black */
  --surface: rgba(20, 24, 38, 0.6);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text-main: #f1f3f9;
  --text-muted: #a0a5b5;
  --accent-neon: #00e0ff;
  /* Neon cyan */
  --accent-glow: rgba(0, 224, 255, 0.3);
  --accent-secondary: #9048ff;
  /* Neon purple */

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);

  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  --border-radius: 12px;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 15% 50%, rgba(144, 72, 255, 0.07), transparent 35%),
    radial-gradient(circle at 85% 30%, rgba(0, 224, 255, 0.07), transparent 35%);
  background-attachment: fixed;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  letter-spacing: -1px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

a {
  color: var(--accent-neon);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--text-main);
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: var(--spacing-xl) 0;
  position: relative;
}

/* --- Navigation & Footer --- */
header.navbar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(5, 7, 14, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.navbar .logo {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.navbar .logo span {
  color: var(--accent-neon);
}

/* --- Animated logo mark (small orbiting-dot badge before wordmark) --- */
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: conic-gradient(from 180deg, var(--accent-neon), var(--accent-secondary), var(--accent-neon));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 20px -4px rgba(0, 224, 255, 0.6);
  flex-shrink: 0;
}

.logo-mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 7px;
  background: var(--bg-color);
}

.logo-mark::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-main);
  z-index: 1;
  animation: logoOrbit 4s linear infinite;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

@keyframes logoOrbit {
  from { transform: rotate(0deg) translateX(9px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(9px) rotate(-360deg); }
}

.footer-col .logo .logo-mark {
  width: 28px;
  height: 28px;
}

@media (prefers-reduced-motion: reduce) {
  .logo-mark::before {
    animation: none;
  }
}

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

.nav-links a,
.nav-links .dropdown-toggle {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links .dropdown-toggle:hover,
.nav-links .dropdown-toggle.active {
  color: var(--text-main);
}

footer {
  background: rgba(10, 12, 20, 0.9);
  border-top: 1px solid var(--surface-border);
  padding: var(--spacing-lg) 0 2rem;
  margin-top: var(--spacing-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 1.2rem;
  color: #fff;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.8rem;
}

.footer-col ul li a {
  color: var(--text-muted);
}

.footer-bottom {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--surface-border);
  padding-top: 2rem;
}

/* --- Dropdown Menu --- */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(10, 12, 20, 0.95);
  border: 1px solid var(--surface-border);
  border-radius: var(--border-radius);
  list-style: none;
  padding: 1rem 0;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  margin-bottom: 0;
  padding: 0;
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: background 0.3s, color 0.3s;
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-neon);
}

/* --- UI Components --- */
.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  border-radius: 30px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-neon), var(--accent-secondary));
  color: #000;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 224, 255, 0.5);
  color: #000;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--surface-border);
}

.btn-outline:hover {
  border-color: var(--accent-neon);
  color: var(--accent-neon);
  background: rgba(0, 224, 255, 0.05);
}

.glass-panel {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-panel:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Gradient Text Extractor */
.text-gradient {
  background: linear-gradient(135deg, var(--accent-neon), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* Forces its own compositing layer so the text-clip mask doesn't break
     when an ancestor is mid-transform-animation (fade-in-up/fade-trigger).
     Without this, some Chromium builds paint a solid box instead of
     clipping the gradient to the letters. */
  transform: translateZ(0);
  will-change: transform;
}

/* --- Hero Section Specific --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 80px;
  /* Offset for navbar */
  position: relative;
}

.hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

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

.bg-grid::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 0%, var(--bg-color) 80%);
}

/* --- Utility Grids --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 3rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

/* Prevent large stat headers (e.g. "Optimized", "100% Pass") from
   overflowing narrow cards in 4-column grids. */
.grid-4 .glass-panel h3 {
  font-size: clamp(1.5rem, 3.2vw, 2.5rem) !important;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.2;
}

/* --- Mobile Nav --- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 1100;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 2px;
  background-color: var(--text-main);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background-color: var(--accent-neon);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background-color: var(--accent-neon);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    background: rgba(10, 12, 20, 0.98);
    backdrop-filter: blur(12px);
    border-left: 1px solid var(--surface-border);
    flex-direction: column;
    padding-top: 100px;
    padding-left: 2rem;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    z-index: 1050;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links li {
    margin-bottom: 1.5rem;
  }
  
  .nav-links .btn {
    padding: 0.5rem 1rem;
    width: auto;
    display: inline-block;
  }

  .dropdown-menu {
    display: none;
  }
  
  .dropdown.mobile-active .dropdown-menu {
    display: block;
    position: relative;
    padding: 0;
    margin-top: 10px;
    background: transparent;
    border: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin-left: 1rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .glass-panel {
    padding: 1.5rem;
  }

  /* Tighter container/section padding so text has more breathing room
     on narrow phones without wasting space on side margins. */
  .container {
    padding: 0 1.25rem;
  }

  section {
    padding: 3.5rem 0;
  }

  h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  /* Roadmap/journey timeline: pull the indent in so the dots and text
     don't crowd the left edge on small screens. */
  .timeline {
    padding-left: 2rem !important;
  }

  .timeline-dot {
    left: -2.6rem !important;
  }

  /* Contact form and other two-column layouts already stack via
     .grid-2 above; just tighten the gap so it doesn't feel too loose. */
  .grid-2 {
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .hero-orb {
    filter: blur(40px);
  }

  .hero-orb.orb-1, .hero-orb.orb-2 {
    width: 220px;
    height: 220px;
  }

  .hero-orb.orb-3 {
    width: 160px;
    height: 160px;
  }
}

/* Decorative canvases (particle network, mouse-glow, laser-scanner) stay
   visible on all screen sizes — nothing is removed on mobile. */

/* Animation Utilities */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s forwards ease-out;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Directional trigger classes: pair with .fade-trigger, e.g. class="fade-trigger dir-left" */
.dir-down { --anim-name: fadeInDown; }
.dir-left { --anim-name: fadeInLeft; }
.dir-right { --anim-name: fadeInRight; }
.dir-up { --anim-name: fadeInUp; }

/* --- Image animations --- */
img {
  max-width: 100%;
  transition: transform 0.5s ease, filter 0.5s ease;
}

.img-animate {
  opacity: 0;
  transform: scale(0.9);
  animation: imgPopIn 0.8s forwards ease-out;
}

@keyframes imgPopIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.glass-panel img,
.img-animate {
  will-change: transform;
}

.glass-panel:hover img {
  transform: scale(1.06);
  filter: brightness(1.1);
}

/* --- Cursor animation (desktop only) --- */
body.custom-cursor-active {
  cursor: none;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-neon);
  box-shadow: 0 0 10px var(--accent-glow);
  transition: opacity 0.2s ease;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--accent-neon);
  opacity: 0.6;
  transition: width 0.25s ease, height 0.25s ease, opacity 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

body.custom-cursor-active.cursor-hover .cursor-ring {
  width: 60px;
  height: 60px;
  background: rgba(0, 224, 255, 0.08);
  border-color: var(--accent-secondary);
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }
  body.custom-cursor-active {
    cursor: auto;
  }
}

/* --- Animated hero background (home page) --- */
.hero-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: orbFloat 18s ease-in-out infinite;
}

.hero-orb.orb-1 {
  width: 380px;
  height: 380px;
  top: -80px;
  left: 8%;
  background: radial-gradient(circle, var(--accent-neon), transparent 70%);
  animation-duration: 16s;
}

.hero-orb.orb-2 {
  width: 420px;
  height: 420px;
  bottom: -120px;
  right: 5%;
  background: radial-gradient(circle, var(--accent-secondary), transparent 70%);
  animation-duration: 22s;
  animation-delay: -4s;
}

.hero-orb.orb-3 {
  width: 260px;
  height: 260px;
  top: 40%;
  left: 45%;
  background: radial-gradient(circle, #ff4d9d, transparent 70%);
  opacity: 0.35;
  animation-duration: 20s;
  animation-delay: -8s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -30px) scale(1.08); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(-40px, -20px) scale(1.05); }
}

.bg-grid {
  animation: gridDrift 40s linear infinite;
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 400px 400px, 400px 400px; }
}

/* --- Typewriter effect (home page hero) --- */
.typewriter-cursor {
  display: inline-block;
  margin-left: 3px;
  color: var(--accent-neon);
  animation: blinkCursor 0.9s steps(1) infinite;
}

@keyframes blinkCursor {
  50% { opacity: 0; }
}

/* --- Particle Network Background (home page) --- */
.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .particle-canvas {
    display: none;
  }
  .hero-orb, .bg-grid, .fade-in-up, .fade-trigger, .img-animate {
    animation: none !important;
  }
}

/* Adding staggered delays */
.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

/* --- Tabs --- */
.tab-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--surface-border);
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  border-color: var(--accent-neon);
  color: var(--text-main);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent-neon), var(--accent-secondary));
  color: #000;
  border-color: transparent;
  box-shadow: 0 4px 15px var(--accent-glow);
  font-weight: 600;
}

.tab-pane {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-pane.active {
  opacity: 1;
  transform: translateY(0);
}

/* --- Flagship product cards (canvas-animated) --- */
.product-card {
  border-radius: 24px;
  border: 1px solid var(--surface-border);
  padding: 3rem;
  position: relative;
  overflow: hidden;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.4s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.product-card.cyan {
  background: linear-gradient(160deg, rgba(0, 224, 255, 0.08), transparent 55%), var(--surface);
}

.product-card.violet {
  background: linear-gradient(160deg, rgba(144, 72, 255, 0.1), transparent 55%), var(--surface);
}

.product-card.cyan:hover {
  border-color: rgba(0, 224, 255, 0.4);
}

.product-card.violet:hover {
  border-color: rgba(144, 72, 255, 0.4);
}

.product-card canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
  pointer-events: none;
}

.product-card .pc-content {
  position: relative;
  z-index: 2;
}

.product-card .pc-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
  display: block;
  font-weight: 700;
}

.product-card.cyan .pc-eyebrow {
  color: var(--accent-neon);
}

.product-card.violet .pc-eyebrow {
  color: var(--accent-secondary);
}

.product-card .pc-list {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.product-card .pc-list span {
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--surface-border);
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  background: rgba(4, 5, 10, 0.4);
}

@media (max-width: 768px) {
  .product-card {
    min-height: unset;
    padding: 2rem;
  }
}