/* ==========================================================================
   Bugout Tech LLP — Custom CSS
   Tailwind CDN handles utilities; this file covers keyframes, transitions,
   and patterns that utility classes alone cannot express.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Google Font: Inter
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --color-primary:   #2563eb;
  --color-secondary: #4f46e5;
  --color-accent:    #06b6d4;
  --color-dark:      #0f172a;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* --------------------------------------------------------------------------
   Scroll reveal
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for card grids */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* --------------------------------------------------------------------------
   Hero background mesh / gradient animation
   -------------------------------------------------------------------------- */
@keyframes mesh-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33%       { transform: translate(20px, -15px) rotate(1deg); }
  66%       { transform: translate(-15px, 10px) rotate(-1deg); }
}

@keyframes hero-pulse {
  0%, 100% { opacity: 0.15; }
  50%       { opacity: 0.25; }
}

.hero-mesh {
  animation: mesh-drift 18s ease-in-out infinite;
}

.hero-orb {
  animation: hero-pulse 6s ease-in-out infinite;
  will-change: opacity;
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.navbar-transparent {
  background: transparent;
  transition: background var(--transition-base), box-shadow var(--transition-base),
              backdrop-filter var(--transition-base);
}

.navbar-scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dark .navbar-scrolled {
  background: rgba(15, 23, 42, 0.92);
}

/* Mega menu */
.mega-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.mega-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobile drawer */
.mobile-drawer {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-drawer.open {
  transform: translateX(0);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card-hover {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -8px rgba(37, 99, 235, 0.12);
}

/* Tech card tilt effect */
.tech-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  transform-style: preserve-3d;
}

.tech-card:hover {
  transform: perspective(600px) rotateX(-3deg) rotateY(3deg) translateY(-4px);
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.1);
}

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

/* --------------------------------------------------------------------------
   Process timeline
   -------------------------------------------------------------------------- */
.timeline-connector {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary));
  transform: translateX(-50%);
}

@media (max-width: 768px) {
  .timeline-connector {
    left: 20px;
  }
}

.timeline-step-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px white, 0 0 0 6px var(--color-primary);
  flex-shrink: 0;
}

.dark .timeline-step-dot {
  box-shadow: 0 0 0 4px #0f172a, 0 0 0 6px var(--color-primary);
}

/* --------------------------------------------------------------------------
   FAQ accordion
   -------------------------------------------------------------------------- */
.faq-answer {
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
}

.faq-answer.open {
  max-height: 400px;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Contact form
   -------------------------------------------------------------------------- */
.form-input {
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-error {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-4px); }
  75%       { transform: translateX(4px); }
}

/* --------------------------------------------------------------------------
   HTMX transitions
   -------------------------------------------------------------------------- */
.htmx-swapping {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.htmx-settling {
  opacity: 0;
  transform: translateY(8px);
}

.htmx-settling.htmx-added {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* --------------------------------------------------------------------------
   Floating WhatsApp button
   -------------------------------------------------------------------------- */
@keyframes whatsapp-bounce {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

.whatsapp-btn {
  animation: whatsapp-bounce 3s ease-in-out infinite;
  will-change: transform;
}

.whatsapp-btn:hover {
  animation: none;
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   Back to top button
   -------------------------------------------------------------------------- */
.back-to-top {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Cookie banner
   -------------------------------------------------------------------------- */
.cookie-banner {
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.visible {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Gradient text utility
   -------------------------------------------------------------------------- */
.text-gradient {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-cyan {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --------------------------------------------------------------------------
   Section divider
   -------------------------------------------------------------------------- */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}

.dark .section-divider {
  background: linear-gradient(to right, transparent, #1e293b, transparent);
}

/* --------------------------------------------------------------------------
   Prose overrides for legal pages (privacy, terms)
   -------------------------------------------------------------------------- */
.legal-content h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.dark .legal-content h2 {
  color: #f1f5f9;
}

.legal-content p {
  line-height: 1.8;
  color: #475569;
  margin-bottom: 1rem;
}

.dark .legal-content p {
  color: #94a3b8;
}

.legal-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  color: #475569;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.dark .legal-content ul {
  color: #94a3b8;
}

/* --------------------------------------------------------------------------
   Print styles
   -------------------------------------------------------------------------- */
@media print {
  .navbar-scrolled, .mobile-drawer, .whatsapp-btn,
  .back-to-top, .cookie-banner { display: none !important; }
}
