/* ============================
   DefenzON — Main Stylesheet
   ============================ */

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: #0f1117;
  color: #ffffff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================
   Custom Scrollbar
   ============================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1a1d27; }
::-webkit-scrollbar-thumb { background: #6366f1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #818cf8; }

/* ============================
   Keyframe Animations
   ============================ */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(99,102,241,0.3); }
  50% { box-shadow: 0 0 40px rgba(99,102,241,0.6); }
}
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================
   Scroll Animations
   ============================ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.delay-5 { transition-delay: 0.5s; }

/* ============================
   Hero
   ============================ */
.hero-gradient {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.15) 0%, transparent 60%),
              radial-gradient(ellipse 60% 40% at 80% 20%, rgba(139,92,246,0.1) 0%, transparent 50%),
              #0f1117;
}

/* ============================
   Grid Pattern Overlay
   ============================ */
.grid-pattern {
  background-image:
    linear-gradient(rgba(99,102,241,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ============================
   Gradient Text
   ============================ */
.gradient-text {
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-danger {
  background: linear-gradient(135deg, #ef4444, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================
   Buttons
   ============================ */
.btn-magnetic {
  position: relative;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}
.btn-magnetic:hover {
  box-shadow: 0 0 30px rgba(99,102,241,0.4);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  padding: 14px 32px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99,102,241,0.4);
}

.btn-outline {
  background: transparent;
  color: #fff;
  padding: 14px 32px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid rgba(99,102,241,0.5);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-outline:hover {
  border-color: #6366f1;
  background: rgba(99,102,241,0.1);
  transform: translateY(-2px);
}

/* ============================
   Cards
   ============================ */
.card-hover {
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid rgba(45,49,60,0.8);
}
.card-hover:hover {
  border-color: rgba(99,102,241,0.4);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 30px rgba(99,102,241,0.1);
}

/* ============================
   Code Block
   ============================ */
.code-block {
  background: #1a1d27;
  border: 1px solid #2d313c;
  border-radius: 10px;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}
.code-header {
  background: #252932;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #2d313c;
}
.code-dot {
  width: 12px; height: 12px; border-radius: 50%;
}
.code-body {
  padding: 16px 20px;
  overflow-x: auto;
}

/* ============================
   Section Divider
   ============================ */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.3), transparent);
}

/* ============================
   Pricing
   ============================ */
.popular-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  padding: 4px 20px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ============================
   FAQ Accordion
   ============================ */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), padding 0.4s ease;
}
.faq-item.open .faq-answer {
  max-height: 500px;
}
.faq-icon {
  transition: transform 0.3s ease;
}
.faq-item.open .faq-icon {
  transform: rotate(45deg);
}


/* ============================
   Capability Tabs
   ============================ */
.cap-tab {
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.cap-tab.active {
  border-bottom-color: #6366f1;
  color: #6366f1;
}
.cap-content {
  display: none;
  animation: fade-in 0.4s ease;
}
.cap-content.active {
  display: block;
}

/* ============================
   Navbar
   ============================ */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #6366f1;
  transition: width 0.3s ease;
}
.nav-link:hover::after {
  width: 100%;
}

/* ============================
   Dashboard Screenshot Showcase
   ============================ */
.dashboard-showcase {
  position: relative;
}
.dashboard-showcase::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.15), rgba(34, 211, 238, 0.2));
  border-radius: 18px;
  z-index: -1;
  filter: blur(1px);
}
.dashboard-showcase::after {
  content: '';
  position: absolute;
  inset: 30px;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.15), transparent 70%);
  border-radius: 18px;
  z-index: -2;
  filter: blur(40px);
}
.dashboard-frame {
  background: linear-gradient(160deg, #1a1d27, #20232d);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 80px -20px rgba(99, 102, 241, 0.15);
  transition: box-shadow 0.5s ease, transform 0.5s ease;
}
.dashboard-frame:hover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 30px 60px -12px rgba(0, 0, 0, 0.6),
    0 0 100px -20px rgba(99, 102, 241, 0.25);
  transform: translateY(-4px);
}
.dashboard-frame .frame-bar {
  background: linear-gradient(180deg, #252932, #1e222a);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(45, 49, 60, 0.8);
}
.dashboard-frame .frame-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.dashboard-frame .frame-bar .dot-red { background: #ef4444; }
.dashboard-frame .frame-bar .dot-yellow { background: #eab308; }
.dashboard-frame .frame-bar .dot-green { background: #22c55e; }
.dashboard-frame .frame-content {
  position: relative;
  background: linear-gradient(135deg, #12141a, #181b23);
  min-height: 200px;
}
.dashboard-frame .frame-content img {
  width: 100%;
  height: auto;
  display: block;
}
.dashboard-frame .frame-content .screenshot-placeholder {
  width: 100%;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #585e6c;
  font-size: 13px;
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.03), rgba(139, 92, 246, 0.02)),
    repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(99, 102, 241, 0.03) 19px, rgba(99, 102, 241, 0.03) 20px),
    repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(99, 102, 241, 0.03) 19px, rgba(99, 102, 241, 0.03) 20px);
}
.dashboard-frame .frame-content .screenshot-placeholder svg {
  opacity: 0.3;
}

/* Large hero showcase - perspective tilt */
.hero-dashboard {
  perspective: 1200px;
}
.hero-dashboard .dashboard-frame {
  transform: rotateX(2deg) rotateY(-2deg);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
}
.hero-dashboard:hover .dashboard-frame {
  transform: rotateX(0) rotateY(0) translateY(-4px);
}

/* Floating badges on screenshots */
.screenshot-badge {
  position: absolute;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: float 4s ease-in-out infinite;
  z-index: 10;
}
.screenshot-badge.badge-blocked {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  top: 20%;
  right: -12px;
  animation-delay: 0s;
}
.screenshot-badge.badge-protected {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  bottom: 25%;
  left: -12px;
  animation-delay: 1.5s;
}
.screenshot-badge.badge-scan {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  top: 15%;
  left: -8px;
  animation-delay: 0.8s;
}

/* ============================
   Counter
   ============================ */
.counter-value {
  font-variant-numeric: tabular-nums;
}

/* ============================
   Mobile Nav
   ============================ */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-menu.open {
  transform: translateX(0);
}

/* ============================
   Attack Flow Diagrams
   ============================ */
.scenario-tab {
  cursor: pointer;
}
.scenario-tab.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}
.scenario-tab:hover:not(.active) {
  border-color: rgba(99, 102, 241, 0.25);
  color: #cbd5e1;
}
.scenario-panel {
  animation: fade-in 0.5s ease;
}
.attack-flow-step {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.attack-flow-step.visible {
  opacity: 1;
  transform: translateY(0);
}
.attack-flow-step[data-step="2"] { transition-delay: 0.2s; }
.attack-flow-step[data-step="3"] { transition-delay: 0.4s; }

/* ============================
   Accessibility: Reduced Motion
   ============================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}
