/* CRM service page visual treatment. Scoped to services/crm.html only. */

body.crm-page {
  --crm-hero-light: url("crm-hero-light.webp");
  --crm-hero-dark: url("crm-hero-dark.webp");
  --crm-workflow-light: url("crm-workflow-light.webp");
  --crm-workflow-dark: url("crm-workflow-dark.webp");
  --crm-visual-blend: multiply;
  --crm-visual-opacity: 0.78;
  --crm-line-wash: color-mix(in oklab, var(--amber) 24%, transparent);
}

:root[data-theme="dark"] body.crm-page {
  --crm-visual-blend: screen;
  --crm-visual-opacity: 0.9;
  --crm-line-wash: color-mix(in oklab, var(--cyan) 20%, transparent);
}

body.crm-page main {
  position: relative;
  isolation: isolate;
}

body.crm-page .hero.small {
  min-height: min(780px, 78vh);
  isolation: isolate;
}

body.crm-page .hero .grid-bg {
  opacity: 0.3;
  -webkit-mask-image: radial-gradient(ellipse at 62% 42%, #000 0%, rgba(0, 0, 0, 0.5) 42%, transparent 76%);
  mask-image: radial-gradient(ellipse at 62% 42%, #000 0%, rgba(0, 0, 0, 0.5) 42%, transparent 76%);
}

.crm-hero-art {
  position: absolute;
  z-index: 1;
  inset: 58px -10vw auto auto;
  width: min(1180px, 78vw);
  height: min(760px, 76vh);
  pointer-events: none;
  opacity: var(--crm-visual-opacity);
}

.crm-hero-art::after,
.crm-flow-art::after,
body.crm-page .cta-block::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.crm-hero-art::after {
  background:
    linear-gradient(90deg, var(--ink) 0%, color-mix(in oklab, var(--ink) 68%, transparent) 25%, transparent 58%),
    linear-gradient(180deg, var(--ink) 0%, transparent 18%, transparent 74%, var(--ink) 100%);
  opacity: 0.82;
}

.crm-theme-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at 70% 48%, #000 0%, #000 37%, rgba(0, 0, 0, 0.62) 56%, rgba(0, 0, 0, 0.22) 70%, transparent 88%);
  mask-image: radial-gradient(ellipse at 70% 48%, #000 0%, #000 37%, rgba(0, 0, 0, 0.62) 56%, rgba(0, 0, 0, 0.22) 70%, transparent 88%);
  animation: crm-drift 24s ease-in-out infinite alternate;
}

.crm-theme-img-light {
  display: block;
  opacity: 0.74;
  filter: saturate(0.9) contrast(0.96) brightness(1.03);
  mix-blend-mode: multiply;
}

.crm-theme-img-dark {
  display: none;
}

:root[data-theme="dark"] .crm-hero-art::after {
  opacity: 0.55;
  background:
    linear-gradient(90deg, var(--ink) 0%, color-mix(in oklab, var(--ink) 72%, transparent) 32%, transparent 62%),
    linear-gradient(180deg, var(--ink) 0%, transparent 16%, transparent 76%, var(--ink) 100%);
}

:root[data-theme="dark"] .crm-theme-img-light {
  display: none;
}

:root[data-theme="dark"] .crm-theme-img-dark {
  display: block;
  opacity: 0.9;
  filter: saturate(1.04) contrast(1.08);
  mix-blend-mode: screen;
}

body.crm-page .hero-inner {
  z-index: 3;
  min-width: 0;
}

body.crm-page .hero .display {
  max-width: 9.5ch;
  text-shadow: 0 18px 44px color-mix(in oklab, var(--ink) 70%, transparent);
}

body.crm-page .hero .lead {
  width: min(100%, 62ch);
  min-width: 0;
  overflow-wrap: break-word;
}

.crm-approach-section,
.crm-capabilities-section,
.crm-faq-section {
  overflow: hidden;
  isolation: isolate;
}

.crm-approach-section .wrap,
.crm-capabilities-section .wrap,
.crm-faq-section .wrap,
body.crm-page .cta-block .cta-inner {
  position: relative;
  z-index: 2;
}

.crm-flow-art {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: var(--crm-visual-blend);
}

.crm-flow-art::after {
  background:
    linear-gradient(90deg, var(--ink) 0%, transparent 34%, transparent 100%),
    radial-gradient(ellipse at 70% 48%, transparent 0%, transparent 52%, var(--ink) 88%);
  opacity: 0.74;
}

.crm-flow-art .crm-theme-img {
  animation: crm-drift-soft 28s ease-in-out infinite alternate;
}

.crm-approach-art {
  inset: 8px -14vw auto auto;
  width: min(1020px, 68vw);
  height: 520px;
}

.crm-capabilities-section::before,
.crm-faq-section::before {
  content: "";
  position: absolute;
  pointer-events: none;
  background-image: linear-gradient(90deg, transparent, var(--crm-line-wash), transparent);
  height: 1px;
  opacity: 0.42;
  transform: translateX(12%);
  animation: crm-line-sweep 12s ease-in-out infinite alternate;
}

.crm-capabilities-section::before {
  top: 64px;
  right: 0;
  width: min(760px, 56vw);
}

.crm-faq-section::before {
  top: 38px;
  left: 0;
  width: min(620px, 48vw);
  transform: translateX(-12%);
}

body.crm-page .principles,
body.crm-page .faq-list,
body.crm-page .cta-block {
  position: relative;
  overflow: hidden;
}

body.crm-page .principles {
  background:
    linear-gradient(115deg, color-mix(in oklab, var(--ink-2) 86%, transparent), transparent),
    color-mix(in oklab, var(--ink) 94%, var(--paper) 6%);
}

body.crm-page .prin {
  position: relative;
  overflow: hidden;
}

body.crm-page .prin::after {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0%, var(--crm-line-wash) 46%, transparent 49%),
    radial-gradient(circle at 86% 18%, color-mix(in oklab, var(--amber) 16%, transparent), transparent 34%);
  opacity: 0;
  transform: translate3d(-8px, 0, 0);
  transition: opacity 0.35s ease, transform 0.45s ease;
}

body.crm-page .prin:hover::after {
  opacity: 0.28;
  transform: translate3d(0, 0, 0);
}

body.crm-page .faq-list::after {
  content: "";
  position: absolute;
  inset: -120px -18vw -80px 42%;
  pointer-events: none;
  background-image: var(--crm-workflow-light);
  background-size: cover;
  background-position: right center;
  opacity: 0.14;
  filter: saturate(0.88) contrast(0.94);
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.35) 26%, #000 72%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.35) 26%, #000 72%, transparent 100%);
}

:root[data-theme="dark"] body.crm-page .faq-list::after {
  background-image: var(--crm-workflow-dark);
  opacity: 0.18;
  filter: saturate(1.04) contrast(1.06);
  mix-blend-mode: screen;
}

body.crm-page .faq-item {
  position: relative;
  z-index: 1;
}

body.crm-page .cta-block::after {
  z-index: 0;
  inset: -24% -12% -28% auto;
  width: min(880px, 62%);
  background-image: var(--crm-workflow-light);
  background-size: cover;
  background-position: center right;
  opacity: 0.16;
  filter: saturate(0.84) contrast(0.94) brightness(1.03);
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.44) 30%, #000 72%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.44) 30%, #000 72%, transparent 100%);
  animation: crm-drift-soft 30s ease-in-out infinite alternate;
}

:root[data-theme="dark"] body.crm-page .cta-block::after {
  background-image: var(--crm-workflow-dark);
  opacity: 0.24;
  filter: saturate(1.06) contrast(1.08);
  mix-blend-mode: screen;
}

@keyframes crm-drift {
  from { transform: translate3d(0, 0, 0) scale(1.01); }
  to { transform: translate3d(-18px, 10px, 0) scale(1.045); }
}

@keyframes crm-drift-soft {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-12px, -8px, 0) scale(1.025); }
}

@keyframes crm-line-sweep {
  from { opacity: 0.18; transform: translateX(14%); }
  to { opacity: 0.48; transform: translateX(-6%); }
}

@media (max-width: 900px) {
  body.crm-page .hero.small {
    min-height: 660px;
  }

  body.crm-page .hero-inner {
    width: min(100%, calc(100vw - 40px));
  }

  body.crm-page .hero-meta {
    justify-content: flex-start;
  }

  body.crm-page .hero-meta .mono {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body.crm-page .hero .lead {
    max-width: calc(100vw - 40px);
  }

  .crm-hero-art {
    inset: 92px -56vw auto auto;
    width: 162vw;
    height: 500px;
    opacity: 0.58;
  }

  .crm-approach-art {
    inset: auto -52vw 24px auto;
    width: 152vw;
    height: 360px;
    opacity: 0.16;
  }

  body.crm-page .statement-grid {
    position: relative;
    z-index: 1;
  }

  body.crm-page .faq-list::after {
    inset: auto -58vw -80px auto;
    width: 136vw;
    height: 320px;
    opacity: 0.1;
  }

  body.crm-page .cta-block::after {
    inset: auto -44% -24% auto;
    width: 118%;
    height: 78%;
    opacity: 0.12;
  }
}

@media (max-width: 560px) {
  body.crm-page .hero.small {
    min-height: 620px;
  }

  .crm-hero-art {
    inset: 116px -96vw auto auto;
    width: 220vw;
    height: 430px;
    opacity: 0.48;
  }

  :root[data-theme="dark"] .crm-hero-art {
    opacity: 0.58;
  }

  .crm-approach-art {
    inset: auto -92vw 16px auto;
    width: 214vw;
    height: 300px;
    opacity: 0.12;
  }

  .crm-capabilities-section::before,
  .crm-faq-section::before {
    width: 82vw;
    opacity: 0.24;
  }

  body.crm-page .faq-list::after {
    display: none;
  }

  body.crm-page .cta-block::after {
    inset: auto -78% -26% auto;
    width: 164%;
    height: 70%;
    opacity: 0.1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .crm-theme-img,
  body.crm-page .cta-block::after,
  .crm-capabilities-section::before,
  .crm-faq-section::before {
    animation: none !important;
  }

  body.crm-page .prin::after {
    transition: none !important;
  }
}
