/* Base Oito — Design System */

:root {
  --navy: #081B2B;
  --cyan: #00C8FF;
  --white: #FFFFFF;
  --gray-tech: #A5B1BD;
  --graphite: #1A1F26;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--navy);
  color: var(--white);
  font-family: 'Inter', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Manrope', sans-serif;
}

/* Glassmorphism Card */
.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(0, 200, 255, 0.15);
  transform: translateY(-2px);
}

/* Header scroll state */
#header.scrolled {
  background: rgba(8, 27, 43, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#header.scrolled .max-w-\[1400px\] > nav {
  padding: 0;
}

/* Link underline animation */
nav a:not(.inline-flex) {
  position: relative;
}

nav a:not(.inline-flex)::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--cyan);
  transition: width 0.3s ease;
}

nav a:not(.inline-flex):hover::after {
  width: 100%;
}

/* Particle canvas */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Tech Grid Background */
.tech-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    linear-gradient(to right, rgba(0, 200, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 200, 255, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at center, black 30%, transparent 80%);
  opacity: 0.7;
}

/* Noise Overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Vertical Beams */
.beam-v {
  position: absolute;
  width: 1px;
  height: 180px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 200, 255, 0.6) 50%, transparent 100%);
  opacity: 0;
  z-index: 1;
  animation: beam-fall 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
  filter: blur(0.5px);
  will-change: top, opacity;
}

@keyframes beam-fall {
  0% { top: -200px; opacity: 0; }
  15% { opacity: 0.5; }
  85% { opacity: 0.5; }
  100% { top: calc(100% + 200px); opacity: 0; }
}

/* Conic border card (premium hover) */
.premium-border-card {
  position: relative;
  border-radius: 16px;
  padding: 1px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  isolation: isolate;
}

.premium-border-card .border-track {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 270deg, #00C8FF 360deg);
  animation: border-spin 3.5s linear infinite;
  opacity: 0;
  filter: blur(1px);
  transition: opacity 0.4s ease;
  z-index: 0;
}

.premium-border-card:hover .border-track {
  opacity: 0.6;
}

.premium-border-card .border-fill {
  position: absolute;
  inset: 1px;
  border-radius: 15px;
  background: #081B2B;
  z-index: 1;
}

.premium-border-card .border-content {
  position: relative;
  z-index: 2;
}

@keyframes border-spin {
  to { transform: rotate(360deg); }
}

/* Animated counter */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* Split-line text reveal */
.split-line {
  overflow: hidden;
  display: inline-block;
  line-height: 1.15;
  vertical-align: top;
}

.split-line > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.split-line.revealed > span {
  transform: translateY(0);
}

/* Process Line */
#process-line {
  opacity: 0.7;
  transition: opacity 0.5s ease;
}

.process-node {
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.process-node.active {
  opacity: 1 !important;
  fill: rgba(0, 200, 255, 0.2);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 8px rgba(0, 200, 255, 0.5));
}

@media (max-width: 768px) {
  #process-line {
    display: none;
  }
}

/* Selection */
::selection {
  background-color: rgba(0, 200, 255, 0.25);
  color: var(--white);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--navy);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Reveal animations — initial state set by GSAP via .gsap-init class */
.gsap-init .reveal {
  opacity: 0;
  transform: translateY(24px);
}

/* Focus states */
input:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.1);
}

/* Image treatment */
img {
  max-width: 100%;
  height: auto;
}

/* Print fallback — ensure content remains visible */
@media print {
  .gsap-init .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  #particle-canvas,
  #header,
  .absolute.inset-0.bg-gradient-to-b,
  .absolute.top-1\/2.left-1\/2 {
    display: none !important;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* WhatsApp floating button */
#whatsapp-float {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: whatsapp-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s backwards;
}

@keyframes whatsapp-enter {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#whatsapp-float .animate-ping {
  animation: ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@media (max-width: 640px) {
  #whatsapp-float {
    bottom: 1.25rem;
    right: 1.25rem;
  }
}
