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

:root {
  --envoy-primary: #3380ff;
  --envoy-secondary: #1a5ff5;
  --envoy-accent: #8ec0ff;
  --dark-bg: #040812;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
}

/* === Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  overflow-x: hidden;
}
body {
  background-color: var(--dark-bg);
  color: white;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; }

/* === Hero Background === */
.hero-bg {
  background:
    radial-gradient(circle at 20% 30%, rgba(26, 95, 245, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  position: absolute;
  inset: 0;
  z-index: -1;
}

.mesh-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(at 0% 0%, rgba(26, 95, 245, 0.15) 0, transparent 50%),
    radial-gradient(at 50% 0%, rgba(59, 130, 246, 0.1) 0, transparent 50%),
    radial-gradient(at 100% 0%, rgba(26, 95, 245, 0.15) 0, transparent 50%);
  filter: blur(100px);
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
}

/* === Custom Animations === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

@keyframes shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: 0.5s;
}

.shine-effect:hover::after {
  animation: shine 1.5s infinite;
}

/* === Glassmorphism === */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.glass-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.glass-card:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(51, 128, 255, 0.4);
  transform: translateY(-10px);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5), 0 18px 36px -18px rgba(51, 128, 255, 0.3);
}

/* === Navbar === */
.navbar-scrolled {
  background: rgba(4, 8, 18, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 0 !important;
}

#mobile-menu.hidden {
  display: none !important;
}

#mobile-menu:not(.hidden) {
  display: flex !important;
}

@media (min-width: 1024px) {
  #mobile-menu {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  #mobile-menu {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    overflow-y: auto;
    background: rgba(4, 8, 18, 0.98) !important;
  }

  #mobile-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* === Typography Helpers === */
.text-gradient {
  background: linear-gradient(to right, #fff, #8ec0ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-blue {
  background: linear-gradient(to right, #3380ff, #1a5ff5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* === Reveal Animations === */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: all 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Bento Grid (Custom) === */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 240px;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .bento-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
}

.bento-item {
  position: relative;
  overflow: hidden;
}

.bento-item-large { grid-column: span 2; grid-row: span 2; }
.bento-item-wide { grid-column: span 2; }
.bento-item-tall { grid-row: span 2; }

/* === Mobile Polish === */
@media (max-width: 640px) {
  html {
    scroll-padding-top: 82px;
  }

  nav.fixed {
    padding: 1rem 0 !important;
    background: rgba(4, 8, 18, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  nav .px-6,
  main.px-6,
  #navbar .px-6,
  section .px-6,
  footer .px-6 {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  #mobile-menu {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem 1.25rem !important;
    overflow-y: auto;
    background: rgba(4, 8, 18, 0.98) !important;
    border: 0;
  }

  #mobile-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  #mobile-menu a:not(:last-child) {
    min-height: 2.75rem;
    font-size: 1.75rem !important;
    line-height: 1.1;
  }

  #mobile-menu a:last-child {
    width: min(100%, 18rem);
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    min-height: 3.75rem;
    line-height: 1.15;
    border-radius: 999px !important;
  }

  #mobile-close {
    top: 1.25rem !important;
    right: 1.25rem !important;
    z-index: 1000;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  section {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
  }

  main {
    padding-top: 7rem !important;
    padding-bottom: 4rem !important;
  }

  #hero {
    min-height: auto;
    padding-top: 7.5rem !important;
    padding-bottom: 4.5rem !important;
  }

  #hero .grid,
  #modules .grid,
  #benefits .grid {
    gap: 3rem !important;
  }

  #hero h1 {
    font-size: clamp(3rem, 15vw, 4.25rem) !important;
    line-height: 0.95 !important;
  }

  h1 {
    font-size: clamp(2.65rem, 13vw, 3.75rem) !important;
    line-height: 1 !important;
    overflow-wrap: anywhere;
  }

  h2 {
    font-size: clamp(2.25rem, 11vw, 3rem) !important;
    line-height: 1.02 !important;
    overflow-wrap: anywhere;
  }

  p {
    font-size: 1rem;
  }

  #hero p {
    font-size: 1.05rem !important;
  }

  #hero .flex.flex-wrap {
    flex-direction: column;
  }

  #hero .flex.flex-wrap a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  #hero .border-t {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem !important;
    margin-top: 2.5rem !important;
    padding-top: 1.5rem !important;
    padding-bottom: 0 !important;
  }

  #hero .border-t .w-px {
    display: none;
  }

  #hero .border-t p {
    overflow-wrap: anywhere;
  }

  #hero .border-t p:first-child {
    font-size: 1.75rem !important;
  }

  #hero img,
  #modules img {
    width: 100%;
    max-width: 100%;
    transform: none !important;
    border-radius: 1.25rem !important;
  }

  .animate-float {
    animation: none;
  }

  .bento-grid {
    gap: 1rem;
  }

  .bento-item-large,
  .bento-item-wide,
  .bento-item-tall {
    grid-column: span 1;
    grid-row: span 1;
  }

  .bento-item,
  .glass-card {
    min-width: 0;
  }

  .glass-card {
    padding: 1.5rem !important;
  }

  .glass-card section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .glass-card section.p-6 {
    padding: 1.25rem !important;
  }

  .glass-card:hover {
    transform: none;
  }

  .bento-item-large .border-t {
    flex-wrap: wrap;
    gap: 0.75rem !important;
  }

  #modules .flex.gap-6 {
    gap: 1rem !important;
  }

  .list-disc {
    list-style-position: outside !important;
    margin-left: 1.25rem !important;
  }

  h2.flex {
    align-items: flex-start;
    gap: 0.75rem !important;
  }

  h2.flex i {
    margin-top: 0.2rem;
  }

  #contact .glass-card {
    border-radius: 1.5rem !important;
    padding: 2rem 1.25rem !important;
  }

  #contact h2 {
    font-size: clamp(2.5rem, 13vw, 3.5rem) !important;
  }

  #contact a {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  main a.inline-flex {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  footer .flex.gap-6 {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.75rem;
  }

  footer p {
    text-align: center;
    line-height: 1.6;
  }
}
