@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
  --bg-color: #030305;
  --text-main: #ffffff;
  --text-muted: #a0a0b0;
  --primary: #7b2cbf;
  --primary-glow: rgba(123, 44, 191, 0.5);
  --secondary: #00f5ff;
  --secondary-glow: rgba(0, 245, 255, 0.4);
  --surface: rgba(255, 255, 255, 0.03);
  --surface-border: rgba(255, 255, 255, 0.08);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
}

/* 3D Canvas */
#canvas-3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  /* Behind everything */
  pointer-events: none;
  background: transparent;
}

/* Background Blobs */
.bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.6;
  animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--secondary);
  bottom: -200px;
  right: -100px;
  animation-delay: -10s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(100px, 50px) scale(1.2);
  }
}

/* Parallax Elements */
.parallax-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.p-item {
  position: absolute;
  color: var(--secondary);
  opacity: 0.15;
  font-weight: 800;
  font-family: monospace;
  white-space: nowrap;
  pointer-events: none;
  filter: blur(1px);
}

.p-shape {
  width: 100px;
  height: 100px;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  border-radius: 20px;
  opacity: 0.08;
}

.p-1 {
  top: 20%;
  left: 10%;
  font-size: 24px;
}

.p-2 {
  top: 60%;
  left: 85%;
  font-size: 32px;
}

.p-3 {
  top: 15%;
  left: 80%;
  transform: rotate(15deg);
}

.p-4 {
  top: 80%;
  left: 15%;
  font-size: 20px;
}

.p-5 {
  top: 45%;
  left: 5%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  opacity: 0.05;
}

.p-6 {
  top: 35%;
  left: 90%;
  font-size: 28px;
  transform: rotate(-90deg);
}

/* Navbar */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 20px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: rgba(3, 3, 5, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
}

.logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--text-main), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  position: fixed;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
  z-index: 101;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.3s;
}

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

/* Buttons */
.btn {
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--secondary-glow);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px;
  position: relative;
}

.hero-pill {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 14px;
  color: var(--secondary);
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
  animation: fadeInDown 1s ease;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  max-width: 900px;
  animation: fadeInUp 1s ease 0.2s backwards;
}

.highlight {
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 40px;
  animation: fadeInUp 1s ease 0.4s backwards;
}

.hero-cta {
  animation: fadeInUp 1s ease 0.6s backwards;
}

/* Services */
.services {
  padding: 100px 5%;
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 36px;
  margin-bottom: 60px;
  font-weight: 800;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 15px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Individual Physics Boundaries (Invisible) */
.card-wrapper {
  position: relative;
  width: 100%;
  height: 360px; /* Reduced box height */
  overflow: hidden;
}

.card {
  background: rgba(10, 10, 15, 0.6); /* More readable dark glassmorphism */
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 30px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
}

@media (min-width: 769px) {
  .card-wrapper .card {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 40px); 
    max-width: 350px;
    height: 300px;
    z-index: 10;
    will-change: transform;
    /* Remove default CSS transitions so JS handles smooth physics */
    transition: box-shadow 0.3s ease, border-color 0.3s ease; 
  }

  .card-wrapper .card:hover {
    z-index: 20;
    box-shadow: 0 10px 30px var(--primary-glow);
    border-color: var(--primary);
  }
}

@media (max-width: 768px) {
  .card-wrapper {
    position: relative;
    height: 350px; /* Tighter box for mobile */
    border: none;
    background: transparent;
    overflow: hidden; /* Constrain the bounce */
    margin-bottom: 10px;
  }
  .card-wrapper .card {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 20px);
    height: auto;
  }
}

.card-icon {
  font-size: 40px;
  margin-bottom: 20px;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card h3 {
  font-size: 24px;
  margin-bottom: 15px;
  font-weight: 600;
}

.card p {
  color: var(--text-muted);
  font-size: 16px;
}

/* About Section */
.about-section {
  padding: 100px 5%;
  max-width: 1400px;
  margin: 0 auto;
}

.about-content {
  display: flex;
  align-items: center;
  gap: 60px;
  flex-wrap: wrap;
}

.about-image {
  flex: 1;
  min-width: 300px;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.about-image:hover img {
  transform: scale(1.05);
}

.about-text {
  flex: 1;
  min-width: 300px;
}

.about-text p {
  color: var(--text-muted);
  font-size: 18px;
  margin-bottom: 20px;
}

.about-text strong {
  color: var(--text-main);
  font-weight: 600;
}

/* Contact Form Section */
.contact-section {
  padding: 100px 5%;
  max-width: 800px;
  margin: 0 auto;
}

.contact-container {
  padding: 40px;
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.form-group label {
  font-weight: 600;
  color: var(--text-main);
  font-size: 14px;
}

.form-group input {
  padding: 15px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--secondary);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.btn-submit {
  margin-top: 10px;
  width: 100%;
  font-size: 16px;
  padding: 15px;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--surface-border);
  color: var(--text-muted);
  margin-top: 50px;
}

.footer-links {
  margin-top: 15px;
  font-size: 14px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
  margin: 0 5px;
}

.footer-links a:hover {
  color: var(--secondary);
}

/* Legal Pages Styling */
.legal-page {
  padding-top: 120px;
}

.legal-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 5%;
  line-height: 1.8;
}

.legal-content h1 {
  font-size: 48px;
  margin-bottom: 40px;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.legal-content h2,
.legal-content h3 {
  margin-top: 40px;
  margin-bottom: 20px;
  color: var(--text-main);
}

.legal-content section {
  margin-bottom: 40px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 30px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

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

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
  nav {
    justify-content: center;
    padding: 15px 5%;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(3, 3, 5, 0.98);
  }

  nav>.btn {
    display: none;
    /* Hide top CTA on mobile to save space */
  }

  .logo {
    margin: 0 auto;
  }

  .nav-links {
    position: fixed;
    top: auto !important;
    /* Explicitly unset top for Safari */
    bottom: 30px !important;
    /* Move it slightly up for Safari safe area */
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90%;
    max-width: 400px;
    /* Keep it compact on mobile */
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: 100px;
    padding: 12px 20px;
    justify-content: space-around;
    gap: 10px;
    z-index: 9999;
    /* Ensure it stays on top */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    -webkit-transform: translateX(-50%) translateZ(0);
    /* Safari hardware acceleration trigger */
  }

  .nav-links a {
    font-size: 13px;
    font-weight: 600;
  }

  .hero h1 {
    font-size: 38px; /* Slightly larger for impact, but balanced */
    line-height: 1.2;
  }

  .section-title {
    font-size: 28px;
    margin-bottom: 40px;
  }

  section {
    padding: 60px 5% !important;
  }

  .about-content {
    flex-direction: column;
    gap: 30px;
  }

  .contact-container {
    padding: 20px;
  }

  footer {
    padding-bottom: 120px;
    /* Make space for floating nav */
  }
}