/* =========================================================
   SERVICES UNIFIED - Optimized CSS Foundation
   Consolidated styling for all service pages
========================================================= */

:root {
  /* Colors */
  --services-bg: #0e1a24; --services-bg-muted: #0f2431; --services-surface: #102836;
  --services-border: #244957; --services-text: #e6f2f4; --services-text-muted: #c3d3d8;
  --services-primary: #5AA7A3; --services-primary-dark: #1d3b48;
  
  /* Animations */
  --anim-fast: 0.15s; --anim-normal: 0.25s; --anim-slow: 0.4s;
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Spacing */
  --spacing-xs: 0.25rem; --spacing-sm: 0.5rem; --spacing-md: 1rem;
  --spacing-lg: 1.5rem; --spacing-xl: 2rem; --spacing-2xl: 3rem;
  
  /* Shadows & Effects */
  --shadow-elevated: 0 8px 24px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --shadow-floating: 0 12px 32px rgba(90,167,163,.22), 0 0 0 1px rgba(90,167,163,.35) inset;
  --interactive-bg: rgba(90,167,163,.08); --interactive-bg-hover: rgba(90,167,163,.12);
  --gradient-interactive: radial-gradient(140px 80px at var(--mx,50%) var(--my,0%), rgba(90,167,163,.28), transparent 60%);
  
  /* Layout */
  --container-max-width: 1120px; --touch-target-minimum: 44px;
}

/* Base Theme */
body.services-dark {
  --bg: var(--services-bg); --surface: var(--services-surface); --border: var(--services-border);
  --text: var(--services-text); --text-muted: var(--services-text-muted); --primary: var(--services-primary);
  background: linear-gradient(180deg, var(--services-bg) 0%, #0f2230 70%); color: var(--text);
}

/* Layout System */
.container { max-width: var(--container-max-width); margin: 0 auto; padding: 0 1rem; }
.two { display: grid; grid-template-columns: 1fr; gap: var(--spacing-md); }
@media (min-width: 900px) { .two { grid-template-columns: 1fr 1fr; gap: 1.25rem; } }

/* Typography */
.section-title { font-size: 2rem; margin-bottom: var(--spacing-md); text-align: center; color: var(--text); }
.section-subtitle { font-size: 1.1rem; color: var(--text-muted); text-align: center; margin-bottom: var(--spacing-xl); max-width: 800px; margin-left: auto; margin-right: auto; }

/* Card System */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 1.1rem 1.2rem; transition: transform var(--anim-normal) ease, box-shadow var(--anim-normal) ease;
  will-change: transform;
}
.card:hover { box-shadow: var(--shadow-floating); }
.card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: var(--gradient-interactive); opacity: 0; transition: opacity var(--anim-normal) ease;
}
.card:hover::before { opacity: 1; }
.card h3 { margin: 0 0 0.35rem; font-size: 1.2rem; }

/* Button System */
.btn {
  display: inline-block; font-weight: 700; border-radius: 999px; padding: 0.55rem 0.9rem;
  text-decoration: none; transition: transform var(--anim-fast) ease, box-shadow var(--anim-fast) ease;
  cursor: pointer; border: none; font-family: inherit;
}
.btn-primary { background: var(--primary); color: var(--primary-dark); box-shadow: 0 3px 12px rgba(90,167,163,.36); }
.btn-primary:visited { color: var(--primary-dark); }
.btn-primary:hover { background: #0d1820; color: #ffffff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(90,167,163,.46); }
.btn-outline { background: transparent; color: #ffffff; border: 1px solid rgba(255,255,255,0.4); }
.btn-outline:visited { color: #ffffff; }
.btn-outline:hover { background: var(--primary); color: #0d1820; border-color: var(--primary); transform: translateY(-1px); }

/* Bento Box System */
.bento-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--spacing-lg); margin-top: var(--spacing-lg); }
@media (min-width: 768px) { .bento-container { grid-template-columns: repeat(2, 1fr); } }

.bento-box {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 0; cursor: pointer; overflow: hidden; min-height: 180px; will-change: transform;
  transition: transform var(--anim-normal) var(--ease-out-quart), box-shadow var(--anim-normal) ease, border-color var(--anim-normal) ease;
}
.bento-box:hover { transform: translateY(-3px); box-shadow: var(--shadow-floating); }
.bento-box::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; background: var(--gradient-interactive); opacity: 0; transition: opacity var(--anim-normal) ease; }
.bento-box:hover::after { opacity: 1; }
.bento-box:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }

.bento-box[data-expanded="true"] {
  background: var(--services-bg-muted); border-color: var(--primary); transform: none;
  box-shadow: 0 8px 32px rgba(90,167,163,.25), 0 0 0 1px rgba(90,167,163,.4) inset;
}
.bento-box[data-expanded="true"]::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--primary), rgba(90,167,163,.6)); z-index: 1; }

.bento-header { display: flex; align-items: center; justify-content: space-between; padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md); position: relative; z-index: 2; }
.bento-header h3 { font-size: 1.3rem; font-weight: 700; margin: 0; color: var(--text); transition: color var(--anim-normal) ease; }
.bento-box[data-expanded="true"] .bento-header { background: var(--interactive-bg); border-bottom: 1px solid var(--border); }
.bento-box[data-expanded="true"] .bento-header h3 { color: var(--primary); }

.expand-toggle {
  background: var(--interactive-bg); border: 1px solid var(--border); border-radius: 8px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); flex-shrink: 0;
  transition: all var(--anim-fast) var(--ease-out-quart);
}
.expand-toggle:hover { color: var(--primary); background-color: var(--interactive-bg-hover); transform: scale(1.05); }
.expand-icon { transition: transform var(--anim-normal) var(--ease-out-quart); width: 20px; height: 20px; }
.bento-box[data-expanded="true"] .expand-toggle { background-color: var(--primary); border-color: var(--primary); color: var(--services-bg); }
.bento-box[data-expanded="true"] .expand-icon { transform: rotate(180deg); }

.bento-preview { padding: 0 var(--spacing-lg) var(--spacing-lg); transition: opacity var(--anim-normal) var(--ease-out-quart), transform var(--anim-normal) var(--ease-out-quart); }
.bento-preview p { margin: 0 0 var(--spacing-sm); color: var(--text-muted); line-height: 1.5; }

.bento-expanded { max-height: 0; opacity: 0; overflow: hidden; transition: max-height var(--anim-extra-slow) var(--ease-out-quart), opacity var(--anim-normal) var(--ease-out-quart) 0.1s; }
.bento-box[data-expanded="true"] .bento-preview { opacity: 0; transform: translateY(-10px); }
.bento-box[data-expanded="true"] .bento-expanded { max-height: 2000px; opacity: 1; transition: max-height var(--anim-extra-slow) var(--ease-out-quart), opacity var(--anim-normal) var(--ease-out-quart) 0.2s; }

.expanded-content { padding: var(--spacing-lg); }
.expanded-content h4 { font-size: 1.2rem; font-weight: 600; color: var(--primary); margin: 0 0 var(--spacing-sm); position: relative; padding-bottom: var(--spacing-xs); }
.expanded-content h4::after { content: ""; position: absolute; bottom: 0; left: 0; height: 2px; background: var(--primary); width: 0; transition: width var(--anim-slow) var(--ease-out-quart); }
.bento-box[data-expanded="true"] .expanded-content h4::after { width: 40px; }

.capability-grid { display: grid; gap: var(--spacing-lg); margin-top: var(--spacing-md); }
.capability-item { opacity: 0; transform: translateY(20px); }
.capability-item h5 { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0 0 var(--spacing-xs); }
.tech-list { list-style: none; padding: 0; margin: 0; }
.tech-list li { color: var(--text-muted); margin: var(--spacing-xs) 0; padding-left: var(--spacing-md); position: relative; }
.tech-list li::before { content: "→"; position: absolute; left: 0; color: var(--primary); font-weight: bold; }

.bento-box[data-expanded="true"] .capability-item:nth-child(1) { animation: fadeInUp var(--anim-slow) var(--ease-out-quart) 0.4s forwards; }
.bento-box[data-expanded="true"] .capability-item:nth-child(2) { animation: fadeInUp var(--anim-slow) var(--ease-out-quart) 0.5s forwards; }

/* Hero Section */
.hero { position: relative; overflow: hidden; min-height: 100vh; display: grid; align-items: center; padding: 72px 0 24px; text-align: left; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-media .hero-mask { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,26,36,.45), rgba(14,26,36,.65)), radial-gradient(1200px 600px at 50% 20%, rgba(0,0,0,.25), transparent 60%); pointer-events: none; }

.hero h1 { font-size: clamp(3rem, 9vw, 5rem); font-weight: 900; margin: 0.6rem 0 0.4rem; letter-spacing: -0.02em; text-shadow: 0 6px 28px rgba(90,167,163,.18); }
.type-line { margin-top: 0.6rem; font-weight: 800; font-size: clamp(1.6rem, 4.2vw, 2.4rem); color: #cfeeee; }
#typed { color: #bfe7e5; }
.caret { display: inline-block; margin-left: 2px; width: 0.6ch; color: #bfe7e5; animation: blink 0.9s step-end infinite; }
.sub { color: var(--text-muted); max-width: 680px; margin: 0; font-size: 1.06rem; }

/* Services Header */
.services-header { position: absolute; top: 0; left: 0; right: 0; z-index: 50; background: transparent; }
.services-header .nav-link { color: var(--text); }
.services-header .nav-link:hover { background: rgba(90,167,163,.12); color: #b9f2ee; }

/* Metrics System */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--spacing-lg); margin-top: var(--spacing-xl); }
@media (min-width: 1024px) { .metrics-grid { grid-template-columns: repeat(4, 1fr); } }

.metric-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: var(--spacing-lg);
  text-align: center; position: relative; transition: transform var(--anim-normal) ease, box-shadow var(--anim-normal) ease;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-elevated); }
.metric-value { font-size: 2.5rem; font-weight: 900; color: var(--primary); display: block; margin-bottom: var(--spacing-sm); line-height: 1; }
.metric-label { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: var(--spacing-xs); }
.metric-description { font-size: 0.875rem; color: var(--text-muted); line-height: 1.4; }

/* CTA Section */
.cta-section { text-align: center; padding: 3rem 1rem; margin: 2rem 0; background: var(--interactive-bg); border-radius: 16px; }
.cta-title { font-size: 2rem; margin-bottom: 1rem; color: var(--text); font-weight: 700; }
.cta-description { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Utility Classes */
.list { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.list li { margin: 0.25rem 0; }
main#main { padding-top: 0; }

/* Animations */
@keyframes blink { 50% { opacity: 0; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive Design */
@media (max-width: 768px) {
  .container { padding: 0 0.75rem; }
  .section-title { font-size: 1.5rem; }
  .hero { padding: 64px 0 24px; }
  .bento-container { display: flex; flex-direction: column; gap: var(--spacing-md); }
  .bento-box:hover { transform: translateY(-1px); }
  .cta-buttons { flex-direction: column; align-items: center; }
  .cta-buttons .btn { width: 200px; }
  .metrics-grid { grid-template-columns: 1fr; }
}

@media (pointer: coarse) {
  .btn { min-height: var(--touch-target-minimum); padding: 0.75rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .bento-box:hover, .card:hover, .btn:hover { transform: none; }
}

/* =========================================================
   CROSS-BROWSER COMPATIBILITY FIXES
========================================================= */

/* CSS Grid fallback for older browsers */
@supports not (display: grid) {
  .bento-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  
  .bento-box {
    width: calc(50% - 0.75rem);
    margin-bottom: 1.5rem;
  }
  
  @media (max-width: 768px) {
    .bento-box {
      width: 100%;
    }
  }
}

/* Webkit-specific optimizations */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .type-line, 
  h2[aria-live="polite"],
  .hero h1,
  .hero h2 {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  /* Fix Safari transform flickering */
  .bento-box,
  .card,
  .btn {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
}

/* Firefox-specific fixes */
@-moz-document url-prefix() {
  /* Fix Firefox grid gap calculation */
  .bento-container {
    gap: calc(var(--spacing-lg) - 1px);
  }
  
  /* Improve Firefox animation performance */
  .bento-box {
    will-change: auto;
  }
  
  .bento-box:hover {
    will-change: transform, box-shadow;
  }
}

/* Edge Legacy compatibility */
@supports (-ms-ime-align: auto) {
  /* CSS custom properties fallback */
  .section {
    padding: 4rem 0;
    background: #0e1a24;
  }
  
  .section:nth-of-type(even) {
    background: #0f2431;
  }
  
  .bento-box {
    background: #102836;
    border: 1px solid #244957;
  }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  /* Fix iOS viewport units */
  .hero {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }
  
  /* Improve touch targets */
  .expand-toggle,
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Fix iOS scroll momentum */
  .bento-expanded {
    -webkit-overflow-scrolling: touch;
  }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .bento-box::after,
  .card::before {
    /* Sharper gradients on retina displays */
    background-size: 100% 100%;
  }
}

/* Reduced data mode optimizations */
@media (prefers-reduced-data: reduce) {
  .bento-box::after,
  .card::before,
  .hero-media::before {
    background: none;
  }
  
  .hero-media img {
    display: none;
  }
}

/* =========================================================
   PERFORMANCE OPTIMIZATIONS
========================================================= */

/* GPU acceleration for animated elements */
.bento-box,
.card,
.btn,
.expand-toggle,
.metric-card {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Optimize animations for 60fps */
.bento-box {
  transition: transform var(--anim-normal) var(--ease-out-quart), 
              box-shadow var(--anim-normal) ease, 
              border-color var(--anim-normal) ease;
}

.card {
  transition: transform var(--anim-normal) ease, 
              box-shadow var(--anim-normal) ease;
}

.btn {
  transition: transform var(--anim-fast) ease, 
              box-shadow var(--anim-fast) ease;
}

/* Contain layout and paint for better performance */
.bento-container {
  contain: layout style;
}

.bento-box {
  contain: layout style paint;
}

.card {
  contain: layout style paint;
}

/* Optimize pseudo-elements for better rendering */
.bento-box::after,
.card::before {
  will-change: opacity;
  transform: translateZ(0);
}

/* Efficient gradient rendering */
.bento-box::after {
  background: var(--gradient-interactive);
  background-attachment: fixed;
}

/* Optimize text rendering */
.hero h1,
.hero h2,
.section-title {
  text-rendering: optimizeSpeed;
  font-display: swap;
}

/* Reduce paint complexity */
.hero-media {
  transform: translateZ(0);
  will-change: transform;
}

.hero-media img {
  transform: translateZ(0);
  image-rendering: optimizeQuality;
}

/* Optimize scroll performance */
.bento-expanded {
  overflow: hidden;
  contain: layout style paint;
}

/* Efficient animation keyframes */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Memory-efficient selectors */
.services-content * {
  box-sizing: border-box;
}

/* Optimize for mobile performance */
@media (max-width: 768px) {
  .bento-box,
  .card {
    will-change: auto;
  }
  
  .bento-box:hover,
  .card:hover {
    will-change: transform, box-shadow;
  }
  
  /* Reduce animation complexity on mobile */
  .bento-box::after,
  .card::before {
    display: none;
  }
  
  /* Simplify gradients on mobile */
  .hero-media .hero-mask {
    background: rgba(14, 26, 36, 0.7);
  }
}

/* Optimize for low-end devices */
@media (max-width: 480px) {
  .bento-box,
  .card,
  .btn {
    transition-duration: 0.1s;
  }
  
  /* Disable expensive effects on very small screens */
  .bento-box:hover {
    transform: none;
    box-shadow: none;
  }
  
  .card:hover {
    transform: none;
  }
}

/* Critical rendering path optimization */
.above-fold {
  contain: layout style paint;
}

/* Lazy loading optimization */
.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-load.loaded {
  opacity: 1;
}

/* =========================================================
   ACCESSIBILITY ENHANCEMENTS
========================================================= */

/* Screen reader only content */
.sr-only,
.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Enhanced focus indicators */
.bento-box:focus,
.card:focus,
.btn:focus,
.expand-toggle:focus,
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--services-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(90, 167, 163, 0.2);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .bento-box,
  .card {
    border-width: 2px;
    border-color: var(--services-text);
  }
  
  .btn-primary {
    border: 2px solid var(--services-text);
  }
  
  .btn-outline {
    border-width: 2px;
  }
}

/* Ensure adequate touch targets */
.expand-toggle,
.btn,
button,
a {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Improve text spacing for readability */
p, li {
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-bottom: 0.5em;
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--services-primary);
  color: var(--services-bg);
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  top: 6px;
}

/* Ensure interactive elements are clearly distinguishable */
button,
.btn,
a[href],
.bento-box[role="button"] {
  cursor: pointer;
  transition: all var(--anim-fast) ease;
}

button:hover,
.btn:hover,
a[href]:hover,
.bento-box[role="button"]:hover {
  transform: translateY(-1px);
}

/* Improve form accessibility */
input,
select,
textarea {
  border: 2px solid var(--services-border);
  border-radius: 4px;
  padding: 0.75rem;
  font-size: 1rem;
  background: var(--services-surface);
  color: var(--services-text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--services-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(90, 167, 163, 0.2);
}

/* Error and success states */
.error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.success {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
}

/* Ensure sufficient color contrast for links */
a {
  color: var(--services-primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

a:hover {
  color: #4a9b97;
  text-decoration-thickness: 3px;
}

a:visited {
  color: #6b7280;
}

/* Loading states for better UX */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid var(--services-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Ensure animations respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .loading::after {
    animation: none;
  }
  
  .loading::after {
    content: '⏳';
    border: none;
    font-size: 16px;
    width: auto;
    height: auto;
    margin: -8px 0 0 -8px;
  }
}/* =
========================================================
   MOBILE FIXES - Hero and Header Corrections
========================================================= */

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .hero {
    text-align: center !important;
  }
  
  .hero h1,
  .hero h2,
  .hero .type-line,
  .hero .sub {
    text-align: center !important;
  }
  
  /* Override custom grid layouts on mobile */
  .hero .container[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    grid-template-areas: 'eyebrow' 'title' 'type' 'desc' !important;
    text-align: center !important;
  }
  
  /* Fix section headers - remove white backgrounds */
  .section-title,
  h2.section-title,
  .content-section h2,
  .methodology-section h2,
  .service-section h2,
  .section-content h2,
  h2[id*="heading"],
  .cta-title {
    background: none !important;
    background-color: transparent !important;
    color: var(--services-text) !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  /* Optimize bento box spacing for mobile */
  .bento-container {
    margin-top: var(--spacing-md) !important;
    gap: var(--spacing-md) !important;
  }
  
  .content-section {
    padding-top: var(--spacing-lg) !important;
  }
  
  /* Tighter mobile spacing for bento box internals */
  .bento-header {
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-xs) !important;
  }
  
  .bento-preview {
    padding: 0 var(--spacing-md) var(--spacing-sm) !important;
  }
  
  .expanded-content {
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md) !important;
  }
  
  /* Mobile optimizations for implementation sections */
  .methodology-section,
  .content-section[aria-labelledby*="implementation"] {
    padding: var(--spacing-lg) !important;
    margin: var(--spacing-lg) 0 !important;
  }
  
  .methodology-section .card h3::before,
  .content-section[aria-labelledby*="implementation"] .card h3::before {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.75rem !important;
  }
  
  /* Ensure proper mobile text contrast */
  .section-subtitle,
  .content-section p,
  .methodology-section p {
    color: var(--services-text-muted) !important;
    background: none !important;
  }
  
  /* Fix any remaining light mode artifacts */
  .hero,
  .content-section,
  .methodology-section,
  .service-section {
    background: transparent !important;
  }
}/*
 =========================================================
   BENTO BOX ENHANCEMENTS
========================================================= */

/* Improved bento box spacing and interactions */
.bento-container {
  margin-top: var(--spacing-lg);
  gap: var(--spacing-lg);
}

/* Optimize bento box internal spacing */
.bento-header {
  padding: var(--spacing-md) var(--spacing-lg) var(--spacing-sm);
}

.bento-preview {
  padding: 0 var(--spacing-lg) var(--spacing-md);
}

.expanded-content {
  padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
}

.capability-grid {
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.bento-box {
  cursor: pointer;
  transition: all var(--anim-normal) ease;
}

.bento-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-floating);
}

/* =========================================================
   IMPLEMENTATION SECTION ENHANCEMENTS
========================================================= */

/* Enhanced implementation approach sections */
.methodology-section .two,
.content-section .two {
  gap: var(--spacing-lg);
}

/* Implementation section cards with enhanced visual design */
.methodology-section .card,
.implementation-heading + * .card,
.content-section[aria-labelledby*="implementation"] .card {
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--services-primary);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(90, 167, 163, 0.03) 100%);
  transition: all var(--anim-normal) ease;
}

.methodology-section .card:hover,
.implementation-heading + * .card:hover,
.content-section[aria-labelledby*="implementation"] .card:hover {
  border-left-color: #4a9b97;
  transform: translateY(-2px);
  box-shadow: var(--shadow-floating);
}

.methodology-section .card::before,
.implementation-heading + * .card::before,
.content-section[aria-labelledby*="implementation"] .card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, var(--services-primary) 50%, transparent 100%);
  opacity: 0.3;
}

.methodology-section h3,
.implementation-heading + * h3,
.content-section[aria-labelledby*="implementation"] h3 {
  color: var(--services-primary);
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
}

/* Process step indicators with enhanced design */
/* .methodology-section .card h3::before,
.content-section[aria-labelledby*="implementation"] .card h3::before {
  content: counter(step-counter);
  counter-increment: step-counter;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--services-primary) 0%, #4a9b97 100%);
  color: var(--services-bg);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  margin-right: var(--spacing-sm);
  box-shadow: 0 2px 8px rgba(90, 167, 163, 0.3);
} */

/* .methodology-section,
.content-section[aria-labelledby*="implementation"] {
  counter-reset: step-counter;
} */

/* Better visual hierarchy for implementation sections */
.methodology-section,
.content-section[aria-labelledby*="implementation"] {
  background: linear-gradient(135deg, rgba(90, 167, 163, 0.02) 0%, rgba(90, 167, 163, 0.05) 100%);
  border: 1px solid rgba(90, 167, 163, 0.1);
  border-radius: 20px;
  padding: var(--spacing-xl);
  margin: var(--spacing-xl) 0;
  position: relative;
}

.methodology-section::before,
.content-section[aria-labelledby*="implementation"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--services-primary) 0%, rgba(90, 167, 163, 0.3) 100%);
  border-radius: 20px 20px 0 0;
}

/* Timeline connector for implementation steps */
.methodology-section .two,
.content-section[aria-labelledby*="implementation"] .two {
  position: relative;
}

@media (min-width: 900px) {
  .methodology-section .two::after,
  .content-section[aria-labelledby*="implementation"] .two::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 60%;
    background: linear-gradient(180deg, var(--services-primary) 0%, rgba(90, 167, 163, 0.3) 100%);
    transform: translate(-50%, -50%);
    z-index: 0;
  }
  
  .methodology-section .card,
  .content-section[aria-labelledby*="implementation"] .card {
    position: relative;
    z-index: 1;
  }
}/* ===
======================================================
   SECTION HEADER FIXES - Prevent Light Mode Bleeding
========================================================= */

/* Ensure section headers maintain dark theme */
.section-title,
h2.section-title,
.content-section h2,
.methodology-section h2,
.service-section h2,
.section-content h2,
h2[id*="heading"],
.cta-title {
  background: none !important;
  background-color: transparent !important;
  color: var(--services-text) !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Override BrandStyling.css backdrop blur effect for services pages */
.services-dark .section-title::before,
.services-shell .section-title::before,
body.services-dark .section-title::before {
  display: none !important;
  content: none !important;
  background: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Ensure no white backdrop effects on services pages */
.services-dark .section-title,
.services-shell .section-title,
body.services-dark .section-title {
  position: relative;
}

/* Ensure proper spacing and visual hierarchy */
.section-title {
  margin: var(--spacing-xl) 0 var(--spacing-lg);
  font-weight: 700;
}

.section-subtitle {
  margin-bottom: var(--spacing-xl);
  line-height: 1.6;
}

/* Fix for RL and Strategy pages' custom hero grid layout */
.hero .container[style*="grid-template-columns"] {
  align-items: center !important;
}

/* Specific fixes for RL and Strategy pages' grid areas */
.hero .container[style*="grid-template-areas"] {
  align-items: center !important;
}

.hero .container[style*="grid-template-areas"] .type-line,
.hero .container[style*="grid-template-areas"] h2[aria-live="polite"] {
  align-self: center !important;
  justify-self: center !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: none !important;
  margin: 0 !important;
}

/* Override page-specific transforms and positioning */
@media (min-width: 900px) {
  .hero .container .type-line,
  .hero .container h2[aria-live="polite"] {
    transform: none !important;
    align-self: center !important;
    justify-self: center !important;
  }
  
  /* Specific override for RL and Strategy pages */
  .hero .container[style*="grid-template-areas"] .type-line,
  .hero .container[style*="grid-template-areas"] h2[aria-live="polite"] {
    align-self: center !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}/* Addit
ional fixes for hero text positioning */
.hero .type-line,
.hero h2[aria-live="polite"] {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px; /* Ensure minimum height for proper centering */
}

.hero .type-prefix,
.hero #typed,
.hero .caret {
  display: inline;
  vertical-align: baseline;
}

/* Ensure proper grid alignment for RL and Strategy pages */
@media (min-width: 900px) {
  .hero .container[style*="grid-template-areas"] {
    align-items: center !important;
  }
  
  .hero .container[style*="grid-template-areas"] .type-line,
  .hero .container[style*="grid-template-areas"] h2[aria-live="polite"] {
    align-self: center !important;
    justify-self: start !important; /* Align to start of grid area, not center */
    text-align: left !important; /* Keep text left-aligned within the area */
    display: block !important;
    min-height: 80px;
    line-height: 80px;
  }
}

/* Fix typing animation layout - ensure all text stays inline */
.type-line,
h2[aria-live="polite"] {
  display: block !important;
}

.type-prefix,
#typed,
.caret {
  display: inline !important;
  vertical-align: baseline !important;
}