/* ============================================================
   Solutions page — system diagram hero, solution splits,
   real product-UI media compositions.
   ============================================================ */

/* Anchored sections clear the sticky header */
#bedrok-phone,
#bid-connect,
#permit-pulse {
  scroll-margin-top: var(--space-20);
}

/* ---- Hero (dusk-water headline band) ----
   Full-bleed photo runs up behind the translucent sticky header, so the
   dark water reads continuously from the very top of the page. */
.solutions-hero {
  --header-h: 68px;
  margin-top: calc(-1 * var(--header-h));
  padding-top: calc(var(--header-h) + var(--space-16));
  padding-bottom: var(--space-16);
  min-height: min(58vh, 520px);
  display: flex;
  align-items: center;
}

.solutions-hero > .container {
  width: 100%;
}

/* Keep the moody water values visible up top (behind the header) while
   protecting the lead copy lower down where the dusk light lifts */
.solutions-hero .photo-bg::after {
  /* Teal-navy multiply — matches the Who We Help hero (.is-navy) */
  mix-blend-mode: multiply;
  background: linear-gradient(
    rgb(20 50 56 / 0.55) 0%,
    rgb(13 36 45 / 0.72) 55%,
    rgb(9 26 34 / 0.92) 100%
  );
}

/* ---- Build-to-product showcase (full-bleed, parallax) ----
   The section is a fixed "window" cropped to the original 2190:821 band.
   The source image is taller (2190:1121) — its added ceiling and floor
   are the travel buffer, so site.js can slide it on scroll without ever
   exposing a gap. The image is centered in the window at rest. */
.build-showcase {
  position: relative;
  overflow: hidden;
  background: var(--color-canvas);
  aspect-ratio: 2190 / 821;
}

.build-progression {
  margin: 0;
  position: absolute;
  inset: 0;
}

.build-progression img {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .build-progression img {
    transform: translateY(-50%) !important;
  }
}

/* ---- System diagram (signals → core → products) ---- */
.system-diagram {
  display: grid;
  gap: var(--space-4);
  justify-items: center;
  max-width: 1080px;
  margin-inline: auto;
}

.system-col {
  width: 100%;
}

.system-label {
  font-size: var(--text-meta);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-meta);
  text-align: center;
  margin-bottom: var(--space-3);
}

.system-signals .system-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.system-arrow {
  display: grid;
  place-items: center;
  color: var(--color-text-meta);
}

.system-arrow .icon {
  width: 22px;
  height: 22px;
  transform: rotate(90deg); /* stacked flow on mobile */
}

.system-core {
  padding: var(--space-6);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: var(--space-2);
}

.system-core .icon-tile {
  margin-bottom: var(--space-2);
}

.system-core strong {
  font-size: var(--text-h3);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.system-core p {
  font-size: var(--text-small);
  color: var(--color-text-secondary);
}

.system-products {
  display: grid;
  gap: var(--space-3);
}

.system-node {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
}

.system-node .icon-tile {
  width: 40px;
  height: 40px;
  margin: 0;
  flex-shrink: 0;
}

.system-node .icon-tile .icon {
  width: 20px;
  height: 20px;
}

.system-node strong {
  display: block;
  font-size: var(--text-small);
}

.system-node small {
  display: block;
  font-size: var(--text-meta);
  color: var(--color-text-meta);
}

@media (min-width: 900px) {
  .system-diagram {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.15fr) auto minmax(0, 1.25fr);
    align-items: center;
    gap: var(--space-5);
  }

  .system-signals .system-chips {
    flex-direction: column;
    align-items: stretch;
  }

  .system-signals .chip {
    justify-content: center;
  }

  .system-arrow .icon {
    transform: none;
  }
}

/* ---- Solution copy column rhythm ---- */
.solution-copy > * + * {
  margin-top: var(--space-6);
}

.solution-copy h2 {
  margin-top: 0;
}

.solution-copy > p {
  color: var(--color-text-secondary);
  max-width: 520px;
}

/* ---- Real product UI media ----
   Screenshots carry explicit width/height attributes in the HTML,
   so the browser reserves the box and nothing shifts on load. */

/* Web screenshot with a real device phone overlapping its right edge */
.ui-duo {
  position: relative;
  padding-block: var(--space-6);
}

.ui-duo > .ui-shot {
  margin-right: clamp(var(--space-12), 20%, 130px);
}

.ui-duo > .phone-shot {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: min(36%, 208px);
  margin: 0;
}

/* Stack instead of overlap on small screens */
@media (max-width: 767.98px) {
  .ui-duo {
    padding-block: 0;
  }

  .ui-duo > .ui-shot {
    margin-right: 0;
  }

  .ui-duo > .phone-shot {
    position: static;
    transform: none;
    width: min(220px, 62%);
    margin: var(--space-4) auto 0;
  }
}

/* Screenshot stacked above a supporting photo (Bid Connect) */
.media-stack {
  display: grid;
  gap: var(--space-5);
}

.media-stack > .figure-photo {
  aspect-ratio: 21 / 9;
}

/* Workflow steps on this page use h3 for heading order */
.workflow-step h3 {
  margin-bottom: 2px;
}

/* Final CTA — clip the topo texture to the band's rounded corners
   (has-topo carried its own overflow:hidden; bg-topo-dark does not) */
.cta-band.bg-topo-dark {
  overflow: hidden;
}

/* Future-program note */
.program-note {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}

/* ============================================================
   Context hero — product shown full-bleed on the jobsite, with a
   header-navy gradient over the top so the headline reads, fading
   to clear just above the phone so the devices stay crisp.
   ============================================================ */
.context-hero {
  --header-h: 68px;
  position: relative;
  margin-top: calc(-1 * var(--header-h));
  overflow: hidden;
  background: #07202a;
}

.context-hero-media { position: relative; line-height: 0; overflow: hidden; }
.context-hero-media img { display: block; width: 100%; height: auto; }

/* Desktop: crop the tall construction image into a shorter window so it can
   parallax-scroll (site.js translates it) without exposing the cropped edges.
   Centered at rest, so the resting framing matches the full-image view. */
@media (min-width: 768px) {
  .context-hero-media {
    aspect-ratio: 3 / 2;
  }
  .context-hero-media img {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    will-change: transform;
  }
}

@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
  .context-hero-media img {
    transform: translateY(-50%) !important;
  }
}

.context-hero-scrim {
  position: absolute;
  inset: 0;
  /* Multiplied deep blue-green — darkens the framing richly for the copy
     and reaches further down before clearing above the phone. */
  mix-blend-mode: multiply;
  background: linear-gradient(
    180deg,
    rgb(6 26 32 / 0.99) 0%,
    rgb(8 30 38 / 0.97) 28%,
    rgb(11 40 48 / 0.80) 42%,
    rgb(14 48 56 / 0.40) 50%,
    rgb(16 52 60 / 0) 60%
  );
}

/* Copy overlays the dark top band (absolute on desktop) */
.context-hero-copy {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  padding-top: calc(var(--header-h) + clamp(24px, 4.5vw, 64px));
  z-index: 1;
}
/* Wider header so the large display h1 holds two lines, not three;
   the lead stays at a readable measure, centered under it. */
.context-hero-copy .section-header { max-width: 1000px; }
.context-hero-copy .lead {
  color: rgb(255 255 255 / 0.82);
  max-width: 680px;
  margin-inline: auto;
}

/* Mobile: the natural-aspect image is too short to hold the copy, so
   stack — copy sits in a solid navy area above the image. */
@media (max-width: 767.98px) {
  .context-hero-copy {
    position: static;
    transform: none;
    padding: calc(var(--header-h) + var(--space-8)) var(--inset) var(--space-8);
  }
  .context-hero-scrim {
    mix-blend-mode: multiply;
    background: linear-gradient(180deg, rgb(6 26 32 / 0.99) 0%, rgb(10 38 46 / 0) 24%);
  }
}

/* ---- Stacked hero variant (wide/short device composite) ----
   For an ultrawide image the copy shouldn't overlay it (it would cover the
   devices). Instead the copy sits in the navy band above, and the composite
   shows full-width below at its natural aspect — no crop window, no parallax. */
.context-hero.is-stacked .context-hero-media {
  aspect-ratio: auto;
}
.context-hero.is-stacked .context-hero-media img {
  position: static;
  transform: none !important; /* neutralize the site.js ctx-parallax transform */
  width: 100%;
  height: auto;
}
.context-hero.is-stacked .context-hero-scrim {
  display: none;
}

@media (min-width: 768px) {
  .context-hero.is-stacked .context-hero-copy {
    position: static;
    transform: none;
    padding: calc(var(--header-h) + clamp(40px, 6vw, 88px)) var(--inset)
      clamp(32px, 4vw, 56px);
  }
}
