/* SEO By Ganesh — World-Class Phase 2A, progressive enhancement.
   Scoped to public shell and known page sections. No JS/API/tracking changes.
   The existing compiled Tailwind and C2 design layers remain authoritative. */
:root {
  --sbg-p2-ink: #0b172c;
  --sbg-p2-blue: #1d4ed8;
  --sbg-p2-line: #dbe4f1;
  --sbg-p2-shadow: 0 16px 36px -24px rgb(15 23 42 / 0.28);
}

/* Accessible keyboard entry: ensure skip link sits above the fixed navigation. */
#sbg-skip-link:focus,
#sbg-skip-link:focus-visible {
  position: fixed;
  z-index: 1200;
  top: max(10px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  width: auto;
  height: auto;
  padding: 12px 18px;
  clip: auto;
  clip-path: none;
  overflow: visible;
  white-space: normal;
  border-radius: 12px;
  background: #fff;
  color: #0b172c;
  box-shadow: 0 0 0 3px #2563eb, 0 12px 28px rgb(15 23 42 / 0.22);
}

/* Keep keyboard focus discoverable across public controls, including mobile. */
#main-content :where(a, button, input, select, textarea, summary):focus-visible,
#global-header :where(a, button):focus-visible,
#mobile-menu :where(a, button):focus-visible,
footer :where(a, button):focus-visible {
  outline: 3px solid var(--sbg-p2-blue);
  outline-offset: 3px;
}
#main-content section[aria-labelledby="hero-heading"] :where(a, button):focus-visible,
#main-content section[aria-labelledby="case-studies-heading"] a:focus-visible,
footer :where(a, button):focus-visible {
  outline-color: #34d399;
}

/* Fixed 80px navigation must not cover anchor destinations. */
#main-content :is(h1,h2,h3,h4)[id],
#main-content section[id],
#contact-form { scroll-margin-top: 108px; }

/* Cohesive, restrained header surface: leave position/z-index to original code. */
#global-header {
  border-bottom-color: var(--sbg-p2-line);
  box-shadow: 0 5px 28px -20px rgb(15 23 42 / 0.26);
}
#global-header [data-nav-trigger],
#global-header nav > a {
  transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

/* Improve line wrapping without changing copy or heading hierarchy. */
#main-content section[aria-labelledby] > div h2,
#main-content section[aria-labelledby="hero-heading"] h1 {
  text-wrap: balance;
}
#main-content section[aria-labelledby="hero-heading"] p,
#main-content section[aria-labelledby="services-heading"] p,
#main-content section[aria-labelledby="growth-problem-title"] p {
  text-wrap: pretty;
}

/* Premium but lightweight intent selectors — existing AI events remain untouched. */
#main-content section[aria-labelledby="hero-heading"] button[data-ai-consultant-open],
#main-content section[aria-labelledby="growth-problem-title"] button[data-ai-consultant-open] {
  min-height: 48px;
  border-color: var(--sbg-p2-line);
  box-shadow: 0 9px 24px -18px rgb(15 23 42 / .35);
  transition: border-color .2s ease, box-shadow .2s ease,
    background-color .2s ease, color .2s ease, transform .2s ease;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  #main-content section[aria-labelledby="hero-heading"] button[data-ai-consultant-open]:hover,
  #main-content section[aria-labelledby="growth-problem-title"] button[data-ai-consultant-open]:hover {
    transform: translateY(-2px);
    box-shadow: 0 17px 30px -19px rgb(29 78 216 / .36);
  }
}

/* Trust tiles: subtle visual structure with responsive wrap safety. */
#main-content section[aria-labelledby="business-context-title"] .grid.grid-cols-2 > div {
  border: 1px solid #e9eef5;
  box-shadow: 0 9px 20px -20px rgb(15 23 42 / .20);
  min-width: 0;
}
#main-content section[aria-labelledby="business-context-title"] .grid.grid-cols-2 strong {
  overflow-wrap: anywhere;
}

/* Service cards retain their existing markup and links, with consistent elevation. */
#main-content section[aria-labelledby="services-heading"] > div > .grid > * {
  min-width: 0;
  transition: box-shadow .2s ease, border-color .2s ease;
}
@media (hover: hover) {
  #main-content section[aria-labelledby="services-heading"] > div > .grid > *:hover {
    box-shadow: var(--sbg-p2-shadow);
  }
}

/* Give the main conversion step a calmer elevation and clearer field focus. */
#main-content section[aria-labelledby="consultation-heading"] [data-lead-form-wrapper] {
  box-shadow: 0 24px 60px -34px rgb(0 0 0 / .45);
}
#main-content section[aria-labelledby="consultation-heading"] input:not([type="hidden"]):focus-visible {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgb(37 99 235 / .14);
}

/* Helpful for long details on the contact page and small viewports. */
#contact-page .contact-info-panel,
#contact-page .contact-form-panel { min-width: 0; }
#contact-page .contact-info-panel a,
#contact-page .contact-info-panel p { overflow-wrap: anywhere; }
#main-content section[aria-labelledby="growth-problem-title"] button[data-ai-consultant-open] {
  text-align: left;
}

@media (max-width: 359px) {
  #main-content section[aria-labelledby="business-context-title"] .grid.grid-cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  #main-content section[aria-labelledby="growth-problem-title"] button[data-ai-consultant-open] {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #global-header [data-nav-trigger],
  #global-header nav > a,
  #main-content section[aria-labelledby="services-heading"] > div > .grid > *,
  #main-content section[aria-labelledby="hero-heading"] button[data-ai-consultant-open],
  #main-content section[aria-labelledby="growth-problem-title"] button[data-ai-consultant-open] {
    transition: none;
    transform: none;
  }
}

