/* ═══════════════════════════════════════════════════════════
   PRO-FIX — Site-wide professional overrides (loads last)
   ═══════════════════════════════════════════════════════════ */

:root {
  --section-pad: clamp(44px, 5vw, 72px);
  --header-h: 64px;
  --bg-deep: #050a12;
  --bg-primary: #0a1220;
  --bg-surface: #0f1a2c;
  --bg-elevated: #152238;
}

/* ─── Base: dark, atmospheric (decor in ai-theme.css) ─── */
body {
  background: var(--bg-deep) !important;
  color: #e4edf5 !important;
}

/* section tints, ambient, shine — ai-theme.css */

main > section {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

main > section:first-child {
  border-top: none;
}

/* ─── Typography ─── */
h1, h2, h3, h4, h5 {
  color: #ffffff !important;
}

main p,
main li,
main .lead,
.lead {
  color: #cdd9e5 !important;
}

.section-header {
  margin-bottom: clamp(1.25rem, 3vw, 2rem) !important;
}

.section-header h2 {
  margin-bottom: 0.75rem !important;
}

.section-header--center h2::after {
  width: 40px;
  height: 2px;
  margin-top: 1rem;
  opacity: 0.7;
}

.section-header--center .eyebrow {
  background: rgba(61, 184, 191, 0.08) !important;
  border: 1px solid rgba(61, 184, 191, 0.14) !important;
  padding: 0.35rem 0.9rem !important;
}

/* ─── Header & nav ─── */
.site-header.scrolled {
  background: rgba(5, 10, 18, 0.94) !important;
  border-bottom-color: rgba(61, 184, 191, 0.1) !important;
}

.nav-cta {
  background: #2d9ea3 !important;
  border: none !important;
  color: #fff !important;
}

/* ─── Buttons ─── */
.btn {
  border-radius: 6px !important;
}

.btn-primary {
  background: linear-gradient(135deg, #3db8bf, #2a8a90) !important;
  border: 1px solid rgba(61, 184, 191, 0.4) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(61, 184, 191, 0.22) !important;
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(61, 184, 191, 0.32) !important;
  color: #fff !important;
}

.btn-ghost {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

.btn-ghost:hover {
  background: rgba(61, 184, 191, 0.08) !important;
  border-color: #3db8bf !important;
  color: #5eead4 !important;
}

/* ─── Header clearance: handled by sticky header in layout.css ─── */

/* ═══ HOMEPAGE HERO ═══ */
.hero {
  position: relative;
  overflow: hidden;
  border-top: none !important;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-backdrop .hero-media,
.hero-backdrop .hero-overlay,
.hero-backdrop .hero-particles,
.hero-backdrop .hero-3d-wrap {
  position: absolute;
  inset: 0;
}

.hero-backdrop .hero-3d-wrap {
  top: auto;
  bottom: 0;
  right: 0;
  left: auto;
  transform: none;
  width: min(36vw, 400px);
  height: min(36vw, 400px);
  opacity: 0.28;
}

/* Homepage 3D + orbs — layout.css controls visibility */
body:not(.page-home) .hero-orbs {
  display: block !important;
  opacity: 0.55;
}

.page-hero .hero-orbs {
  opacity: 0.4 !important;
}

.page-hero .hero-orb--teal { width: 220px; height: 220px; }
.page-hero .hero-orb--gold { width: 160px; height: 160px; }
.page-hero .hero-orb--purple { width: 120px; height: 120px; }

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.hero-content h1 {
  margin-bottom: 0.75rem !important;
}

.hero-content .eyebrow {
  margin-bottom: 0.65rem !important;
}

.hero-actions {
  margin-top: 1rem !important;
}

.hero-content h1 .line-inner {
  transform: none !important;
  opacity: 1 !important;
}

.hero-scroll {
  display: none !important;
}

.hero-overlay {
  background:
    linear-gradient(180deg, rgba(4, 8, 14, 0.75) 0%, rgba(4, 8, 14, 0.9) 100%),
    linear-gradient(100deg, rgba(4, 8, 14, 0.93) 0%, rgba(4, 8, 14, 0.6) 50%, rgba(4, 8, 14, 0.82) 100%) !important;
}

.hero-particles {
  opacity: 0.25 !important;
}

.hero-media video {
  filter: brightness(0.42) saturate(1.05) !important;
}

.hero-trust {
  border-top: 1px solid rgba(61, 184, 191, 0.12) !important;
  padding-top: 1rem !important;
  margin-top: 1.25rem !important;
}

.hero-trust-item {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  backdrop-filter: none !important;
  color: #cdd9e5 !important;
}

.page-home .stats-strip {
  padding: 1.25rem 0 1.75rem !important;
  margin-top: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ═══ INNER PAGE HEROES ═══ */
.page-hero {
  position: relative;
  overflow: hidden;
  border-top: none !important;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
}

.page-hero-bg img {
  transform: none !important;
  filter: brightness(0.4) saturate(0.9);
}

.page-hero-overlay {
  background:
    linear-gradient(180deg, rgba(4, 8, 14, 0.55) 0%, rgba(4, 8, 14, 0.92) 75%, var(--bg-deep) 100%) !important;
}

.page-hero-content {
  position: relative;
  z-index: 1;
}

.page-hero .eyebrow {
  margin-bottom: 0.65rem !important;
}

.page-hero h1 {
  max-width: 22ch;
  margin-bottom: 0.5rem !important;
  font-size: clamp(1.85rem, 4.5vw, 3.25rem) !important;
}

.page-hero .lead {
  max-width: 36rem;
  margin-bottom: 0 !important;
}

.page-hero .hero-actions {
  margin-top: 1rem !important;
}

.page-hero-content::after {
  display: none !important;
}

/* ═══ Cards & surfaces ═══ */
.stat-card,
.pain-card,
.how-step,
.outcome-card,
.testimonial-card,
.service-card,
.service-detail,
.work-item,
.value-card,
.bento-item,
.faq-item,
.faq-preview-item,
.contact-form-wrap,
.tech-matcher,
.matcher-result,
.blog-card,
.award-card,
.ai-cap,
.intro-feature {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15) !important;
}

.stat-card,
.pain-card,
.how-step,
.outcome-card,
.testimonial-card,
.service-detail,
.work-item,
.value-card,
.faq-item,
.faq-preview-item,
.contact-form-wrap {
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-surface)) !important;
}

/* ═══ Sections spacing ═══ */
.intro,
.services-preview,
.featured-work,
.testimonials,
.about-story,
.values,
.contact-section,
.services-hero-cards,
.work-hero-grid,
.pain-section,
.how-section,
.compare-section,
.faq-preview-section,
.ai-lab,
.cta-strip,
.cta-banner,
.ba-section,
.tech-matcher-section,
.outcomes-strip,
.logos-section,
.work-showcase,
.philosophy-strip,
.blog-listing,
.faq-section,
.quote-section,
.book-section {
  padding-top: var(--section-pad) !important;
  padding-bottom: var(--section-pad) !important;
}

/* ═══ CTA blocks ═══ */
.cta-strip {
  background: var(--bg-surface) !important;
}

.cta-strip-inner {
  background: var(--bg-elevated) !important;
  border: 1px solid rgba(61, 184, 191, 0.12) !important;
  border-radius: 12px !important;
  padding: 1.75rem 2rem !important;
}

.cta-banner-inner {
  border: 1px solid rgba(61, 184, 191, 0.15) !important;
  background: var(--bg-elevated) !important;
}

.cta-banner-inner::before {
  opacity: 0.5;
}

.cta-banner-glow {
  display: block;
}

.guarantee-item {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* ═══ Footer ═══ */
.site-footer {
  background: var(--bg-primary) !important;
  border-top: 1px solid rgba(61, 184, 191, 0.1) !important;
  padding-top: clamp(3rem, 6vw, 4.5rem) !important;
}

.site-footer::before {
  opacity: 0.6;
}

/* ═══ Forms ═══ */
.form-group input,
.form-group textarea,
.form-group select,
.contact-form input,
.contact-form textarea {
  background: var(--bg-surface) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.form-group input:focus,
.form-group textarea:focus,
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #3db8bf !important;
  box-shadow: 0 0 0 2px rgba(61, 184, 191, 0.15) !important;
}

/* ═══ Mobile menu ═══ */
.mobile-menu {
  background: rgba(5, 10, 18, 0.98) !important;
}

.sticky-cta {
  background: rgba(8, 14, 24, 0.96) !important;
  border-top-color: rgba(61, 184, 191, 0.15) !important;
}

/* ═══ Grids — tighter gaps ═══ */
.pain-grid,
.how-steps,
.outcomes-grid,
.services-grid,
.values-grid,
.intro-grid,
.about-story-grid,
.contact-grid,
.bento-grid,
.blog-grid {
  gap: 1.25rem !important;
}

.work-showcase {
  gap: 2.5rem !important;
}

.work-item {
  gap: 1.5rem !important;
}

/* ═══ Homepage overrides ═══ */
.page-home main > section:not(.hero):not(.stats-strip) {
  padding-top: var(--section-pad) !important;
  padding-bottom: var(--section-pad) !important;
}

.page-home .pain-section,
.page-home .tech-matcher-section,
.page-home .intro,
.page-home .services-preview,
.page-home .ba-section,
.page-home .featured-work,
.page-home .testimonials,
.page-home .how-section,
.page-home .faq-preview-section,
.page-home .ai-lab {
  /* tinted backgrounds — ai-theme.css */
  box-shadow: none !important;
}

.page-home .hero-content h1 {
  font-size: clamp(2.35rem, 5.8vw, 4rem) !important;
}

.page-home .service-card {
  min-height: 300px !important;
}

.page-home .bento-item--large {
  min-height: 240px !important;
}

.page-home .ai-core-wrap,
.page-home #ai-core-3d,
.page-home .ai-demo {
  min-height: 260px !important;
}

.page-home .ai-lab-grid {
  margin-bottom: 0 !important;
  min-height: unset !important;
}

/* ═══ Mobile (≤768px) ═══ */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
    --section-pad: clamp(32px, 7vw, 48px);
  }

  .site-header .container {
    gap: 0.5rem;
  }

  .hero,
  .page-hero {
    padding: 0.35rem 0 1rem !important;
  }

  .page-home .hero {
    padding: 1.75rem 0 2.5rem !important;
  }

  .hero-content h1,
  .page-hero h1 {
    font-size: clamp(1.75rem, 7vw, 2.35rem) !important;
    line-height: 1.1 !important;
  }

  .hero-content,
  .page-hero-content {
    text-align: center;
  }

  .hero-actions,
  .hero-trust,
  .page-hero .hero-actions {
    justify-content: center;
  }

  .page-hero h1,
  .page-hero .lead {
    margin-inline: auto;
  }

  .hero-trust {
    margin-top: 1rem !important;
    padding-top: 0.75rem !important;
  }

  .cta-strip-inner {
    flex-direction: column !important;
    text-align: center !important;
    gap: 1rem !important;
    padding: 1.25rem !important;
  }

  .footer-grid {
    text-align: center;
  }

  .footer-brand img {
    margin-inline: auto;
  }

  .work-item {
    flex-direction: column !important;
  }

  .work-item:nth-child(even) {
    direction: ltr !important;
  }
}

/* ═══ Tablet (769–1023px) ═══ */
@media (min-width: 769px) and (max-width: 1023px) {
  :root {
    --header-h: 60px;
  }

  .hero-content,
  .page-hero-content {
    text-align: center;
  }

  .hero-actions,
  .hero-trust,
  .page-hero .hero-actions {
    justify-content: center;
  }
}

/* ═══ Desktop (≥1024px) ═══ */
@media (min-width: 1024px) {
  :root {
    --header-h: 68px;
    --section-pad: clamp(56px, 6vw, 88px);
  }

  .hero-content {
    max-width: 40rem;
    text-align: left;
  }

  .page-hero-content {
    text-align: left;
  }

  .hero-actions,
  .hero-trust,
  .page-hero .hero-actions {
    justify-content: flex-start;
  }

  .page-hero h1 {
    max-width: 16ch;
  }

  .hero-backdrop .hero-3d-wrap {
    width: min(32vw, 360px);
    height: min(32vw, 360px);
    opacity: 0.25;
  }

  .page-home .hero-backdrop .hero-3d-wrap {
    width: min(46vw, 580px) !important;
    height: min(46vw, 580px) !important;
    opacity: 0.72 !important;
  }

  .container {
    width: min(1180px, 92vw);
  }

  .intro-grid,
  .about-story-grid,
  .contact-grid {
    gap: 2.5rem !important;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Kill any leftover min-height heroes site-wide — see layout.css */

@media (prefers-reduced-motion: reduce) {
  .hero-content *,
  .page-hero-content * {
    animation: none !important;
    transition: none !important;
  }
}
