/* =========================================================================
   OSM GLOBAL SHARED STYLES (Tokens, Base, Typography, Nav, Footer)
   Extracted from osm_tokens.css & Wix Active Embeds
   ========================================================================= */

:root {
  /* Brand Gradients & Colors */
  --osm-cyan: #22d3ee;
  --osm-cyan-rgb: 34, 211, 238;
  --osm-purple: #a855f7;
  --osm-purple-rgb: 168, 85, 247;
  --osm-deep-purple: #7c3aed;
  --osm-deep-purple-rgb: 124, 58, 237;
  --osm-magenta: #c026d3;
  --osm-magenta-rgb: 192, 38, 211;
  
  /* Utilities */
  --osm-emerald: #10B981;
  --osm-emerald-rgb: 16, 185, 129;
  --osm-amber: #F59E0B;
  --osm-amber-rgb: 245, 158, 11;
  --osm-red: #EF4444;
  --osm-red-rgb: 239, 68, 68;

  /* Surfaces & Backgrounds */
  --osm-bg: #050510; /* Changed from transparent */
  --osm-surface-1: rgba(18, 18, 32, 0.95);
  --osm-surface-2: rgba(10, 10, 22, 0.98);
  --osm-border-subtle: rgba(255, 255, 255, 0.07);
  --osm-border-hover: rgba(255, 255, 255, 0.18);
  
  /* Text */
  --osm-text-primary: #ffffff;
  --osm-text-secondary: #94a3b8;
  --osm-text-muted: #64748b;
  
  /* Typography */
  --font-primary: 'Questrial', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Base Reset (Wix overrides) */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  /* Critical change from previous Wix embeds: No transparent bg, no hidden overflow */
  background-color: var(--osm-bg) !important;
  color: var(--osm-text-primary);
  font-family: var(--font-primary);
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================================================
   HOMEPAGE — inline embed sections
   ========================================================================= */

/* Each inlined embed section */
.embed-section {
  width: 100%;
  background: var(--osm-bg);
  display: block;
  overflow: visible;
  position: relative;
}

/* Hero text — centered, capped at Wix heading iframe size */
.section-heading_text {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1rem 0;
}

/* Agent 3D globe — constrained to ~1100px like Wix, centered */
.section-osm_agents {
  max-width: 1100px;
  margin: 0 auto;
}

/* How OSM works title */
.section-how_osm_works_title {
  max-width: 900px;
  margin: 2rem auto 0;
  padding: 0 1rem;
}

/* Force hero text to production proportions — cap the vw scaling */
.section-heading_text .hero-title {
  font-size: clamp(1.8rem, 4vw, 4rem) !important;
}

/* How OSM works — force 2-col grid (Wix iframe was ~900px wide, under the 1023px breakpoint) */
.section-how_osm_works .hiw-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}
@media (max-width: 639px) {
  .section-how_osm_works .hiw-grid {
    grid-template-columns: 1fr !important;
  }
}

/* How OSM works cards — give it the same width as Wix (~960px = under 1023px breakpoint —> 2 col) */
.section-how_osm_works {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Why OSM — constrainted to match Wix iframe width where 1fr-300px-1fr grid was designed */
.section-why_osm {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* OSM Advantage — its own CSS uses max-width: 860px */
.section-osm_advantage {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Extensive visibility / unified cyber intel */
.section-extensive_visibility,
.section-unified_cyber_intelligence {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Vertical gaps between sections */
.embed-section + .embed-section { margin-top: 0; }
.embed-section + .section-heading-row { margin-top: 3rem; }
.section-heading-row + .embed-section { margin-top: 1.5rem; }

.section-heading-row {
  width: 100%;
  text-align: center;
  padding: 0 1rem;
}

/* Wix-parity native section headings */
.wix-native-heading {
  font-family: var(--font-primary);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  text-align: center;
  color: var(--osm-text-primary);
  margin: 0 auto 1rem;
  letter-spacing: -0.03em;
  padding: 0 1rem;
}

.wix-native-heading .text-gradient {
  background: linear-gradient(135deg, #22D3EE 0%, #C084FC 45%, #F472B6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline-block;
}


/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--osm-bg); }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* Main Content Wrapper */
.site-main {
  flex: 1 0 auto;
  width: 100%;
  position: relative;
  /* Top padding to account for fixed header */
  padding-top: 80px; 
}

/* =========================================================================
   NAVIGATION BAR
   ========================================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  /* Glassmorphism */
  background: rgba(8, 8, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--osm-border-subtle);
  height: 80px;
  transition: all 0.3s ease;
}

.osm-nav {
  width: 100%;
  height: 100%;
}

.osm-nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.osm-nav-logo a {
  display: flex;
  align-items: center;
}

/* Desktop Links */
.osm-nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
  height: 100%;
}

.nav-item {
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

.nav-link {
  color: var(--osm-text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.2s;
  padding: 10px 0;
}

.nav-link:hover {
  opacity: 1;
}

/* Dropdown styling */
.has-dropdown > .nav-link::after {
  content: '';
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
  border-top: 4px solid currentColor;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.6;
}

.mega-dropdown {
  position: absolute;
  top: 100%;
  left: -20px;
  width: max-content;
  max-width: 100vw;
  background: rgba(12, 12, 28, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 30px;
  display: flex;
  gap: 40px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 100px rgba(var(--osm-cyan-rgb), 0.05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.nav-item.has-dropdown:hover .mega-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 200px;
}

.dropdown-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--osm-cyan);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 8px;
}

.dropdown-group a {
  color: var(--osm-text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s;
  position: relative;
  display: block;
  padding: 4px 0;
}

.dropdown-group a:hover {
  color: #fff;
  transform: translateX(4px);
}

/* Actions */
.osm-nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.login-btn {
  color: var(--osm-text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.login-btn:hover {
  opacity: 1;
}

.demo-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}
.demo-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.demo-btn:hover {
  box-shadow: 0 0 30px rgba(var(--osm-cyan-rgb), 0.5);
  transform: translateY(-2px);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  position: relative;
  transition: 0.3s;
}

.hamburger::before, .hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: white;
  transition: 0.3s;
}
.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

/* Responsive Nav */
@media (max-width: 1024px) {
  .osm-nav-links { gap: 20px; }
  .osm-nav-container { padding: 0 24px; }
  .demo-btn { padding: 8px 18px; }
}

@media (max-width: 900px) {
  .osm-nav-links { display: none; } /* We will add a mobile menu implementation later */
  .mobile-menu-toggle { display: block; }
  .mega-dropdown { display: none !important; }
}

@media (max-width: 768px) {
  .login-btn { display: none !important; }
}

@media (max-width: 480px) {
  .demo-btn { padding: 6px 12px; font-size: 0.85rem; }
  .osm-nav-logo img { width: 130px !important; height: auto; }
  .osm-nav-container { padding: 0 16px; }
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer {
  margin-top: 100px;
  border-top: 1px solid var(--osm-border-subtle);
  background: rgba(8, 8, 16, 0.95);
  padding: 60px 0 20px 0;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  margin-bottom: 20px;
}

.footer-desc {
  color: var(--osm-text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

.footer-heading {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 12px;
}

.footer-col a {
  color: var(--osm-text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.95rem;
}

.footer-col a:hover {
  color: var(--osm-cyan);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--osm-border-subtle);
  color: var(--osm-text-muted);
  font-size: 0.85rem;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  color: var(--osm-text-secondary);
  transition: color 0.2s;
  display: flex;
}

.social-links a:hover {
  color: var(--osm-purple);
}

.social-links .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-brand { max-width: 100%; }
  .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
}

/* =========================================================================
   COMMON COMPONENTS & HELPERS
   ========================================================================= */
.osm-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 768px) {
  .osm-container { padding: 0 24px; }
}

/* Reveal Helpers (IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1), transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

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