/* ==========================================================================
   AWWWARDS-LEVEL MOTION SYSTEM & DIGITAL MARKETING UI
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;600;700&family=Inter:wght@300;400;500;600&display=swap");

:root {
  /* Core Palette - Dark Cinematic */
  --bg-deep: #030305;
  --bg-surface: #0a0a0f;
  --bg-elevated: #12121a;
  --text-primary: #ffffff;
  --text-secondary: #8a8a93;

  /* Neon/Cyber Accents */
  --accent-blue: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-purple: #7c3aed;
  --accent-glow: rgba(37, 99, 235, 0.4);

  /* Motion Graphics & Physics */
  --spring-duration: 0.8s;
  --spring-ease: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --cinematic-ease: cubic-bezier(0.8, 0, 0.2, 1);

  /* Layout */
  --nav-height: 90px;
  --container-w: 1400px;
}

/* -----------------------------------------------------------------------
      BASE & RESET
      ----------------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: auto; /* Handled by custom smooth scroll JS */
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none; /* Custom magnetic cursor active */
}

h1,
h2,
h3,
h4,
h5,
h6,
.display-text {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

a {
  text-decoration: none;
  color: inherit;
  cursor: none;
}
ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 5%;
  position: relative;
  z-index: 2;
}

/* -----------------------------------------------------------------------
      CUSTOM MAGNETIC CURSOR & TRAIL
      ----------------------------------------------------------------------- */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition:
    width 0.3s,
    height 0.3s,
    background 0.3s;
}
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(6, 182, 212, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition:
    width 0.3s,
    height 0.3s,
    border-color 0.3s;
}

/* Hover States for Cursor */
body.cursor-hover .cursor-dot {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(2px);
}
body.cursor-hover .cursor-outline {
  width: 60px;
  height: 60px;
  border-color: transparent;
}

/* -----------------------------------------------------------------------
      PRELOADER & CINEMATIC INTRO
      ----------------------------------------------------------------------- */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-deep);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.preloader-terminal {
  text-align: center;
  perspective: 1000px;
}
.preloader-logo img {
  width: 80px;
  margin-bottom: 20px;
  filter: invert(1) drop-shadow(0 0 20px var(--accent-blue));
  animation: pulse 2s infinite;
}
.preloader-text {
  font-family: "Space Grotesk", monospace;
  font-size: 14px;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  margin-bottom: 15px;
  opacity: 0.8;
}
.preloader-bar-container {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 auto 15px auto;
  overflow: hidden;
  position: relative;
}
.preloader-bar {
  width: 100%;
  height: 100%;
  background: var(--accent-cyan);
  transform: translateX(-100%);
  animation: loadBar 3.5s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

@keyframes loadBar {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(-30%);
  }
  100% {
    transform: translateX(0);
  }
}
@keyframes pulse {
  0%,
  100% {
    transform: scale3d(1, 1, 1);
  }
  50% {
    transform: scale3d(1.1, 1.1, 1.1);
  }
}

/* Cinematic Wipe Out */
.preloader-exit {
  animation: preloaderWipe 1.5s var(--cinematic-ease) forwards;
}
@keyframes preloaderWipe {
  0% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    opacity: 1;
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    opacity: 0;
    visibility: hidden;
  }
}

/* -----------------------------------------------------------------------
      NAVIGATION (Universal Header)
      ----------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  transition:
    background 0.4s,
    backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}
.nav-logo-link img, .footer-brand img {
  height: 60px !important;
  filter: invert(1);
}

.nav-menu {
  display: flex;
  gap: 40px;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  padding: 10px 0;
  overflow: hidden;
  color: var(--text-primary);
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-cyan);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--spring-ease);
}
.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.3s var(--spring-ease),
    box-shadow 0.3s;
  border: none;
  outline: none;
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-primary:hover::before {
  opacity: 1;
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 20px var(--accent-glow);
}

.hamburger {
  display: none;
  background: transparent;
  border: none;
  cursor: none;
  flex-direction: column;
  gap: 6px;
  z-index: 1001;
}
.hamburger .bar {
  width: 30px;
  height: 2px;
  background: #fff;
  transition: 0.3s;
}

/* -----------------------------------------------------------------------
      3D IMMERSIVE HERO SECTION
      ----------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1500px;
  transform-style: preserve-3d;
  overflow: hidden;
  padding-top: var(--nav-height);
}

/* 3D Perspective Grid Floor */
.hero-grid {
  position: absolute;
  bottom: -20vh;
  left: -50%;
  width: 200%;
  height: 80vh;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.2) 1px, transparent 1px);
  background-size: 50px 50px;
  transform: rotateX(75deg);
  transform-origin: top;
  animation: gridMove 20s linear infinite;
  z-index: 0;
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 1), transparent);
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1), transparent);
}
@keyframes gridMove {
  from {
    transform: rotateX(75deg) translateY(0);
  }
  to {
    transform: rotateX(75deg) translateY(50px);
  }
}

/* Ambient Fog & Light */
.hero-light {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  z-index: 1;
  opacity: 0.6;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: 0.1s linear; /* JS Follows mouse */
}

.hero-content {
  text-align: center;
  z-index: 3;
  position: relative;
  transform: translateZ(100px); /* 3D Extrusion */
}

.glitch-title {
  font-size: 6vw;
  line-height: 1;
  font-weight: 700;
  background: linear-gradient(to right, #fff, #8a8a93);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
  position: relative;
}
.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  font-weight: 300;
}

/* -----------------------------------------------------------------------
      SERVICES / OUR POWERS (3D Hover Cards)
      ----------------------------------------------------------------------- */
.section-padding {
  padding: 120px 0;
  position: relative;
}
.section-title {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 20px;
}
.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 80px;
  font-size: 1.2rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  perspective: 1200px;
}

.service-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 40px;
  transform-style: preserve-3d;
  transition:
    transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    background 0.3s;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  /* Animated gradient border */
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: 20px;
  background: linear-gradient(
    45deg,
    transparent,
    var(--accent-blue),
    transparent
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s;
}
.service-card:hover::before {
  opacity: 1;
}
.service-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.service-icon {
  font-size: 2.5rem;
  color: var(--accent-cyan);
  margin-bottom: 20px;
  transform: translateZ(40px); /* Popping out effect */
  display: inline-block;
}
.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  transform: translateZ(30px);
}
.service-card p {
  color: var(--text-secondary);
  transform: translateZ(20px);
  line-height: 1.6;
}

/* -----------------------------------------------------------------------
      DATA DASHBOARD & KPI (Animated Numbers)
      ----------------------------------------------------------------------- */
.dashboard-section {
  background: var(--bg-surface);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.kpi-grid {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.kpi-card {
  flex: 1;
  min-width: 250px;
  padding: 40px;
  text-align: center;
  background: radial-gradient(
    circle at top,
    rgba(37, 99, 235, 0.1) 0%,
    transparent 70%
  );
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
}
.kpi-number {
  font-family: "Space Grotesk", sans-serif;
  font-size: 4rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 0 20px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.kpi-label {
  color: var(--text-secondary);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 10px;
}

/* -----------------------------------------------------------------------
      INTERACTIVE ROI CALCULATOR
      ----------------------------------------------------------------------- */
.calculator-wrapper {
  background: linear-gradient(
    180deg,
    var(--bg-elevated) 0%,
    var(--bg-deep) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 60px;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.calc-row {
  margin-bottom: 40px;
}
.calc-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-weight: 600;
  font-size: 1.2rem;
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 24px;
  width: 24px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  margin-top: -8px;
  box-shadow: 0 0 15px var(--accent-cyan);
  transition: transform 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.calc-result {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.calc-result h4 {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.result-value {
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-shadow: 0 0 30px rgba(6, 182, 212, 0.5);
  font-family: "Space Grotesk";
}

/* -----------------------------------------------------------------------
      TESTIMONIALS (3D Stacked Cards)
      ----------------------------------------------------------------------- */
.testimonials-container {
  height: 400px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}
.test-card {
  position: absolute;
  width: 100%;
  max-width: 600px;
  padding: 50px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transition: all 0.8s var(--spring-ease);
  cursor: none;
}
.test-quote {
  font-size: 1.4rem;
  font-style: italic;
  margin-bottom: 20px;
  color: var(--text-primary);
}
.test-author {
  display: flex;
  align-items: center;
  gap: 15px;
}
.author-info h5 {
  color: var(--accent-cyan);
  font-size: 1.1rem;
}
.author-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* -----------------------------------------------------------------------
      LEGAL & CONTENT PAGES
      ----------------------------------------------------------------------- */
.page-header {
  padding: 180px 0 80px;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(37, 99, 235, 0.1) 0%,
    transparent 100%
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 100px;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #a0a0a0;
}
.legal-content h2 {
  color: #fff;
  margin: 40px 0 20px;
  font-size: 1.8rem;
}
.legal-content p {
  margin-bottom: 20px;
}
.legal-content ul {
  padding-left: 20px;
  margin-bottom: 20px;
}
.legal-content li {
  margin-bottom: 10px;
  list-style-type: square;
  color: var(--accent-cyan);
}
.legal-content li span {
  color: #a0a0a0;
}

/* -----------------------------------------------------------------------
      CONTACT FORM
      ----------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}
.contact-info {
  background: var(--bg-elevated);
  padding: 40px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.info-item {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}
.info-item i {
  font-size: 1.5rem;
  color: var(--accent-cyan);
}
.info-item h4 {
  margin-bottom: 5px;
  color: #fff;
}
.info-item p {
  color: var(--text-secondary);
}

.form-group {
  position: relative;
  margin-bottom: 30px;
}
.form-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  padding: 15px 0;
  color: #fff;
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.3s;
  font-family: "Inter";
}
.form-label {
  position: absolute;
  left: 0;
  top: 15px;
  color: var(--text-secondary);
  transition: 0.3s;
  pointer-events: none;
}
.form-input:focus ~ .form-label,
.form-input:valid ~ .form-label {
  top: -10px;
  font-size: 0.8rem;
  color: var(--accent-cyan);
}
.form-input:focus {
  border-color: var(--accent-cyan);
}
textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

/* -----------------------------------------------------------------------
      FOOTER (Universal)
      ----------------------------------------------------------------------- */
.footer {
  background: var(--bg-elevated);
  padding: 80px 0 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
}
.footer-brand p {
  color: var(--text-secondary);
  margin-top: 20px;
  max-width: 300px;
  line-height: 1.6;
}
.footer-heading {
  font-family: "Space Grotesk";
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 20px;
}
.footer-links li {
  margin-bottom: 12px;
}
.footer-links a {
  color: var(--text-secondary);
  transition:
    color 0.3s,
    transform 0.3s;
  display: inline-block;
}
.footer-links a:hover {
  color: var(--accent-cyan);
  transform: translateX(5px);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-legal-links {
  display: flex;
  gap: 20px;
}

/* -----------------------------------------------------------------------
      UTILITIES & RESPONSIVE
      ----------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s var(--spring-ease);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1024px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 768px) {
  .nav-menu,
  .header-actions .btn-primary {
    display: none;
  }
  .hamburger {
    display: flex;
    cursor: pointer;
  }
  .glitch-title {
    font-size: 10vw;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 20px;
  }
  .cursor-dot,
  .cursor-outline {
    display: none;
  } /* Disable custom cursor on mobile */
  body {
    cursor: auto;
  }
  a {
    cursor: pointer;
  }
}
