/* MAINERMEDIA - Systems Firm Visual Identity */
/* Bloomberg Terminal × Apple Pro Display XDR × Palantir */

/* ============================================
   TYPOGRAPHY SYSTEM
   ============================================ */

/* Import JetBrains Mono for technical/label text */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

/* Custom font optimizations */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'kern' 1, 'liga' 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Technical/mono font for labels and microcopy */
.font-mono, .font-technical {
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  letter-spacing: 0.02em;
}

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

/* Enhanced gradient backgrounds */
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

/* ============================================
   COLOR SYSTEM - Dark Counter-Surfaces
   ============================================ */

:root {
  /* Primary brand */
  --mainermedia-green: #059669;
  --mainermedia-green-light: #10b981;
  --mainermedia-green-accent: #34d399;
  
  /* Dark surfaces (Bloomberg/Palantir inspired) */
  --surface-dark-primary: #0E1116;
  --surface-dark-secondary: #12161D;
  --surface-dark-tertiary: #1A1F2A;
  --surface-dark-elevated: #232A36;
  
  /* Text on dark surfaces */
  --text-on-dark-primary: #E5E7EB;
  --text-on-dark-secondary: #9CA3AF;
  --text-on-dark-muted: #6B7280;
  
  /* Borders */
  --border-dark: rgba(255, 255, 255, 0.08);
  --border-dark-subtle: rgba(255, 255, 255, 0.04);
  --border-green-accent: rgba(16, 185, 129, 0.3);
  
  /* Legacy */
  --mainermedia-black: #000000;
  --mainermedia-gray: #374151;
  --mainermedia-gradient: linear-gradient(135deg, #059669 0%, #374151 100%);
}

/* ============================================
   DARK SECTION STYLES
   ============================================ */

.section-dark {
  background-color: var(--surface-dark-primary);
  color: var(--text-on-dark-primary);
}

.section-dark-alt {
  background-color: var(--surface-dark-secondary);
  color: var(--text-on-dark-primary);
}

/* Grid overlay for dark sections */
.section-dark-grid {
  background-color: var(--surface-dark-primary);
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Subtle dot pattern */
.pattern-dots {
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ============================================
   PANEL SYSTEM (Not Cards)
   ============================================ */

.panel {
  background: var(--surface-dark-elevated);
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  transition: border-color 0.2s ease;
}

.panel:hover {
  border-color: var(--border-green-accent);
}

.panel-light {
  background: #FAFAFA;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  transition: border-color 0.2s ease;
}

.panel-light:hover {
  border-color: var(--mainermedia-green);
}

/* Panel with green accent border */
.panel-accent {
  border-left: 2px solid var(--mainermedia-green);
}

/* ============================================
   SYSTEM VISUALS
   ============================================ */

/* Flow connector line */
.flow-line {
  position: relative;
}

.flow-line::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -2rem;
  width: 1px;
  height: 2rem;
  background: linear-gradient(to bottom, var(--border-green-accent), transparent);
}

/* Horizontal divider with dots */
.divider-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.divider-dots::before,
.divider-dots::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-dark), transparent);
}

/* Signal indicator */
.signal-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-on-dark-muted);
}

.signal-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mainermedia-green);
  box-shadow: 0 0 8px var(--mainermedia-green);
}

/* ============================================
   MOTION SYSTEM
   ============================================ */

/* Fade up on scroll */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Subtle hover pressure effect for CTAs */
.hover-pressure {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hover-pressure:hover {
  transform: scale(0.98);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hover-pressure:active {
  transform: scale(0.96);
}

/* Line draw animation */
@keyframes line-draw {
  from { width: 0; }
  to { width: 100%; }
}

.line-animate {
  animation: line-draw 0.8s ease forwards;
}

/* ============================================
   LABEL STYLES (Technical/Mono)
   ============================================ */

.label-technical {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--mainermedia-green);
}

.label-section {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-on-dark-muted);
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-dark);
  border-radius: 2px;
  display: inline-block;
}

/* ============================================
   BUTTON ENHANCEMENTS
   ============================================ */

/* CTA Button - Green accent, not wash */
.btn-primary {
  background: var(--mainermedia-green);
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: #047857;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Ghost button for dark surfaces */
.btn-ghost-dark {
  background: transparent;
  color: var(--text-on-dark-primary);
  border: 1px solid var(--border-dark);
  padding: 0.875rem 2rem;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-ghost-dark:hover {
  border-color: var(--mainermedia-green);
  color: var(--mainermedia-green);
}

/* Professional SVG Icon Styling */
svg {
  transition: all 0.3s ease;
}

/* Mobile menu button improvements */
#mobile-menu-button {
  min-height: 44px; /* iOS touch target minimum */
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mobile-menu-button svg {
  flex-shrink: 0;
}

.svg-icon-container:hover svg {
  transform: scale(1.1);
}

/* Enhanced icon backgrounds with subtle animation */
.bg-gradient-to-r:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(5, 150, 105, 0.25);
}

/* SVG icon professional sizing and alignment */
svg[viewBox] {
  max-width: 100%;
  height: auto;
}

/* Enhanced button styles for Green/Black/White branding */
button {
  transition: all 0.3s ease;
  transform: translateY(0);
  position: relative;
  overflow: hidden;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(5, 150, 105, 0.3);
}

button:active {
  transform: translateY(0);
}

/* Gradient button enhancement for green theme */
button.bg-gradient-to-r {
  background-size: 200% 200%;
  animation: gradient-shift-green 3s ease infinite;
}

@keyframes gradient-shift-green {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Professional typography with MAINERMEDIA green styling */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.025em;
}

/* Italics styling for MAINERMEDIA taglines */
em {
  font-style: italic;
  color: inherit;
}

/* Enhanced focus states with green theme */
button:focus,
a:focus {
  outline: 3px solid rgba(5, 150, 105, 0.5);
  outline-offset: 2px;
}

/* Card hover effects with green accents and SVG animation */
.hover\:shadow-xl:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

.hover\:shadow-xl:hover svg {
  transform: scale(1.05);
}

/* Enhanced selection highlight with green theme */
::selection {
  background-color: rgba(5, 150, 105, 0.2);
  color: inherit;
}

/* Professional list styling */
ul {
  list-style: none;
  padding: 0;
}

/* Consistent margins */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Professional responsive images */
img {
  max-width: 100%;
  height: auto;
}

/* MAINERMEDIA specific green gradient text */
.text-gradient-green {
  background: linear-gradient(135deg, #059669, #374151);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced border styles with green theme */
.border-gradient-green {
  border: 2px solid;
  border-image: linear-gradient(135deg, #059669, #374151) 1;
}

/* Smooth transitions for all interactive elements */
a, button, [role="button"] {
  transition: all 0.2s ease-in-out;
}

/* Professional spacing and rhythm */
section {
  scroll-margin-top: 2rem;
}

/* Enhanced accessibility with green theme */
*:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
  border-radius: 4px;
}

/* MAINERMEDIA green brand animation */
@keyframes float-green {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-float-green {
  animation: float-green 6s ease-in-out infinite;
}

/* Green hover effects for links */
a:hover {
  color: #059669;
  transition: color 0.2s ease-in-out;
}

/* Enhanced shadow effects with green tint */
.shadow-green {
  box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.1), 0 2px 4px -1px rgba(5, 150, 105, 0.06);
}

.shadow-green-lg {
  box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.1), 0 4px 6px -2px rgba(5, 150, 105, 0.05);
}

/* Professional green accent borders */
.border-green-accent {
  border-color: #10b981;
}

/* Subtle green background tints */
.bg-green-tint {
  background-color: rgba(5, 150, 105, 0.05);
}

/* Professional black text with good contrast */
.text-professional-black {
  color: #111827;
}

/* Icon container professional styling */
.icon-container {
  transition: all 0.3s ease;
  position: relative;
}

.icon-container::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, transparent, rgba(5, 150, 105, 0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.icon-container:hover::before {
  opacity: 1;
}

/* ============================================
   HERO ANIMATIONS
   ============================================ */

/* Progress bar grow animation */
@keyframes grow {
  from {
    width: 0%;
  }
  to {
    width: var(--target-width, 100%);
  }
}

/* Pulse animation for orbs */
@keyframes pulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* Typewriter cursor blink */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Float animation for elements */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Terminal text typing effect */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

/* Glow effect for buttons */
.glow-green {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.glow-green:hover {
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
}

/* ============================================
   MOBILE SERVICES ACCORDION
   ============================================ */

.mobile-services-accordion .services-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.mobile-services-accordion.open .services-submenu {
  display: block;
  max-height: 500px;
}

.mobile-services-accordion.open .services-chevron {
  transform: rotate(180deg);
}

/* ============================================
   MOBILE TOOLS ACCORDION
   ============================================ */

.mobile-tools-accordion .tools-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.mobile-tools-accordion.open .tools-submenu {
  display: block;
  max-height: 500px;
}

.mobile-tools-accordion.open .tools-chevron {
  transform: rotate(180deg);
}

/* ============================================
   MOBILE NAVIGATION - Touch Improvements
   ============================================ */

/* Ensure mobile menu button has adequate touch target */
#mobile-menu-button {
  /* Minimum 44x44px touch target (WCAG 2.1 AAA) */
  min-width: 44px;
  min-height: 44px;
  /* Prevent double-tap zoom on iOS */
  touch-action: manipulation;
  /* Ensure button is always tappable */
  -webkit-tap-highlight-color: rgba(16, 185, 129, 0.2);
  /* Prevent text selection on long press */
  -webkit-user-select: none;
  user-select: none;
  /* Hardware acceleration for smoother animations */
  transform: translateZ(0);
  /* Ensure it's above other elements */
  position: relative;
  z-index: 60;
}

/* Active state for touch feedback */
#mobile-menu-button:active {
  transform: scale(0.95) translateZ(0);
  background: rgba(16, 185, 129, 0.2) !important;
}

/* Mobile menu container improvements */
#mobile-menu {
  /* Smooth animation */
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  /* Ensure menu is scrollable if content is long */
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Ensure mobile nav links have good touch targets */
#mobile-menu a,
#mobile-menu button {
  min-height: 44px;
  display: flex;
  align-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(16, 185, 129, 0.1);
}

/* ============================================
   ACCESSIBILITY - Focus States & Skip Link
   ============================================ */

/* Skip to main content link */
.skip-to-main {
  transition: all 0.2s ease-in-out;
}

/* Enhanced focus states for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

/* Remove default outline when custom focus is applied */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* Focus states for navigation links */
nav a:focus-visible {
  background: rgba(16, 185, 129, 0.15);
  border-radius: 9999px;
}

/* Focus states for buttons with existing styles */
.focus-ring:focus-visible,
button:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* Focus states for form inputs */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
}

/* Focus states for cards and clickable containers */
.card:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.15);
}

/* High contrast focus for better visibility */
@media (prefers-contrast: high) {
  a:focus-visible,
  button:focus-visible,
  input:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
  }
}

/* Reduced motion for focus transitions */
@media (prefers-reduced-motion: reduce) {
  *:focus-visible {
    transition: none;
  }
}

/* Screen reader only utility (for skip links) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ============================================
   DESKTOP SERVICES DROPDOWN
   ============================================ */

/* Ensure dropdown stays visible when hovering */
.group\/services:hover > div {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}