@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&family=Orbitron:wght@500;700;900&display=swap');

:root {
  --bg-dark: #06070b;
  --bg-card: rgba(13, 17, 26, 0.72);
  --bg-card-hover: rgba(20, 27, 42, 0.88);
  --cyan-primary: #00e5ff;
  --cyan-glow: #38bdf8;
  --purple-glow: #a855f7;
  --violet-deep: #6366f1;
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.28);
}

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

body {
  background-color: var(--bg-dark);
  color: #f1f5f9;
  font-family: 'Plus Jakarta Sans', sans-serif;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #06070b;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

/* Headings typography */
h1, h2, h3, h4, .font-heading {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

.font-tech {
  font-family: 'Orbitron', sans-serif;
}

/* Scroll-Driven Video Background */
#video-bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background-color: var(--bg-dark);
}

#video-frame-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.video-backdrop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(6, 7, 11, 0.35) 0%, rgba(6, 7, 11, 0.75) 100%);
}

/* Cosmic Background Glows */
.bg-cosmic-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
  background: 
    radial-gradient(circle at 75% 20%, rgba(56, 189, 248, 0.14) 0%, transparent 40%),
    radial-gradient(circle at 80% 35%, rgba(168, 85, 247, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 15% 60%, rgba(99, 102, 241, 0.10) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(14, 165, 233, 0.08) 0%, transparent 45%);
}

#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2; /* Puntos flotantes de main.js situados por sobre el video animado */
  opacity: 0.85;
}

/* Neon Gradient Text */
.gradient-text-cyan-purple {
  background: linear-gradient(135deg, #60a5fa 0%, #a855f7 60%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-blue-violet {
  background: linear-gradient(120deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 35px rgba(129, 140, 248, 0.35);
}

.gradient-text-cyan {
  background: linear-gradient(135deg, #a5f3fc 0%, #38bdf8 50%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glassmorphism Styles */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 20px 40px -12px rgba(56, 189, 248, 0.15), 0 0 20px rgba(168, 85, 247, 0.1);
  transform: translateY(-4px);
}

.glass-card-active {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.2);
}

/* Nav Header */
.header-glass {
  background: rgba(6, 7, 11, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.header-scrolled {
  background: rgba(6, 7, 11, 0.92);
  border-bottom-color: rgba(56, 189, 248, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

/* Glowing Buttons */
.btn-glow-cyan {
  background: linear-gradient(90deg, #38bdf8 0%, #818cf8 100%);
  color: #040814;
  font-weight: 700;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.45), 0 0 50px rgba(129, 140, 248, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-glow-cyan:hover {
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.7), 0 0 65px rgba(168, 85, 247, 0.4);
  transform: translateY(-2px) scale(1.02);
  color: #000000;
}

.btn-outline-glass {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.btn-outline-glass:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
}

/* Hero Portal Effect */
.portal-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-outer-ring {
  position: absolute;
  width: 104%;
  height: 104%;
  border-radius: 50%;
  border: 2px dashed rgba(56, 189, 248, 0.4);
  animation: rotatePortal 60s linear infinite;
  pointer-events: none;
}

.portal-glow-halo {
  position: absolute;
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, rgba(168, 85, 247, 0.3) 40%, transparent 72%);
  filter: blur(24px);
  pointer-events: none;
  animation: pulsePortal 5s ease-in-out infinite alternate;
}

.portal-image-mask {
  width: 100%;
  max-width: 480px;
  position: relative;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.25), 0 0 100px rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  transition: transform 0.5s ease;
}

.portal-image-mask:hover {
  transform: scale(1.02);
}

.portal-image-mask img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

@keyframes rotatePortal {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulsePortal {
  0% {
    opacity: 0.6;
    transform: scale(0.96);
  }
  100% {
    opacity: 0.95;
    transform: scale(1.04);
  }
}

/* HUD Sci-fi Elements */
.hud-badge {
  background: rgba(13, 17, 26, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.15);
}

.hud-corner-tl {
  position: relative;
}
.hud-corner-tl::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-top: 2px solid #38bdf8;
  border-left: 2px solid #38bdf8;
}

/* Animated Floating */
.floating-element {
  animation: floatAnim 6s ease-in-out infinite alternate;
}

.floating-delayed {
  animation: floatAnim 7s ease-in-out 1.5s infinite alternate;
}

@keyframes floatAnim {
  0% {
    transform: translateY(0px);
  }
  100% {
    transform: translateY(-12px);
  }
}

/* Service Card Hover Arrow Button */
.card-arrow-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover .card-arrow-btn {
  background: #38bdf8;
  color: #06070b;
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
  transform: translateX(4px);
}

/* Case Study Project Cards */
.project-card {
  background: rgba(13, 17, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.2);
  transform: translateY(-6px);
}

.project-card .img-container {
  overflow: hidden;
  background: #090c14;
  position: relative;
}

.project-card img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card:hover img {
  transform: scale(1.08);
}

/* Mouse Scroll Animation */
.mouse-scroll-icon {
  width: 22px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  position: relative;
  display: inline-block;
}

.mouse-scroll-icon::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  width: 4px;
  height: 7px;
  background: #38bdf8;
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollWheel 2s infinite ease-in-out;
}

@keyframes scrollWheel {
  0% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  80% {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
}

/* Stats Section Dividers */
.stat-col {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.stat-col:last-child {
  border-right: none;
}

@media (max-width: 768px) {
  .stat-col {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1.5rem;
  }
  .stat-col:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}

/* Modal styles */
.modal-backdrop {
  background: rgba(4, 6, 10, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Input Fields */
.input-futuristic {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  transition: all 0.25s ease;
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  color-scheme: dark;
}

.input-futuristic:focus {
  outline: none;
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.04);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

select.input-futuristic {
  color-scheme: dark;
  cursor: pointer;
}

select.input-futuristic option {
  background-color: #0b0f19;
  color: #ffffff;
  padding: 10px 14px;
}

/* Alert Banner Styling strictly directly above form action buttons */
.form-alert-container {
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: fadeInAlert 0.3s ease-out forwards;
}

@keyframes fadeInAlert {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Services section spacing to showcase scroll-driven video animation */
#services {
  margin-top: 500px;
  scroll-margin-top: 5rem;
}
