/* Shared color roles for dark and light surfaces. Service tints follow the artwork. */
:root {
  --paper: #262626;
  --copy: #e0e0e0;
  --muted: #c6c6c6;
  --line: #525252;
  --quiet-line: #393939;
  --focus: #ffffff;
  --link: #78a9ff;
  --link-hover: #a6c8ff;
  --link-active: #d0e2ff;
  --gold: #ffd478;
  --apricot: #ffb784;
  --smooth-spectrum: linear-gradient(106deg, var(--rose), var(--lilac));
}
body {
  overflow-x: clip;
  background-image: url("/assets/graphics/grain.png?v=456d7d8df4c045db"),
    url("/assets/graphics/grain.png?v=456d7d8df4c045db");
  background-size: 144px 144px, 144px 144px;
  background-position: 0 0, 72px 72px;
}

/* Keep the texture continuous through dark closing sections and footers. */
.closing-surface, .close, .footer { background-color: transparent; }

/* Raise the grain's underlying tone with the page for a smooth fade. */
body::before {
  background-image: url("/assets/graphics/grain.png?v=456d7d8df4c045db"),
    url("/assets/graphics/grain.png?v=456d7d8df4c045db"),
    linear-gradient(115deg, #2b2b2b, var(--paper) 58%, #2b2b2b);
  background-size: 144px 144px, 144px 144px, 100% 100%;
  background-position: 0 0, 72px 72px, 0 0;
}

/* The artwork field uses the same texture without changing its colors. */
.comoving-art__field {
  background-image: url("/assets/graphics/grain.png?v=456d7d8df4c045db"),
    url("/assets/graphics/grain.png?v=456d7d8df4c045db"),
    linear-gradient(120deg, #1f1f1f, #262626 55%, #292929);
  background-size: 144px 144px, 144px 144px, 100% 100%;
  background-position: 0 0, 72px 72px, 0 0;
}

.offerings,
.detail-content,
.approach-content,
body:has(.contact-heading) main > .editorial,
body:has(footer a[href$="/privacy/"][aria-current="page"]) main > .editorial,
body:not(:has(footer a[href$="/privacy/"][aria-current="page"])) .page-hero ~ .editorial:nth-of-type(even),
body:has(.home-heading) .close {
  --paper: #f4f4f4;
  --ink: #262626;
  --copy: #393939;
  --muted: #525252;
  --line: #c6c6c6;
  --quiet-line: #e0e0e0;
  --focus: #0f62fe;
  --link: #0043ce;
  --link-hover: #002d9c;
  --link-active: #001d6c;
  --gold: #684e00;
  --lilac: #6929c4;
  --rose: #9f1853;
  --apricot: #8a3800;
  --ice: #0043ce;
  --smooth-spectrum: linear-gradient(106deg, var(--rose), var(--lilac));
  color: var(--copy);
}

.offerings,
.detail-content,
.approach-content,
body:has(.contact-heading) main > .editorial,
body:has(footer a[href$="/privacy/"][aria-current="page"]) main > .editorial,
body:not(:has(footer a[href$="/privacy/"][aria-current="page"])) .page-hero ~ .editorial:nth-of-type(even) {
  position: relative;
  isolation: isolate;
  border-color: var(--line);
}

.offerings::before,
.detail-content::before,
.approach-content::before,
body:has(.contact-heading) main > .editorial::before,
body:has(footer a[href$="/privacy/"][aria-current="page"]) main > .editorial::before,
body:not(:has(footer a[href$="/privacy/"][aria-current="page"])) .page-hero ~ .editorial:nth-of-type(even)::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paper);
  box-shadow: 0 0 0 100vmax var(--paper);
  clip-path: inset(0 -100vmax);
  z-index: -1;
  pointer-events: none;
}

body:has(.home-heading) .close {
  background: var(--paper);
}

.offer-row .service-icon { color: var(--accent); }

.manifesto .process {
  color: var(--lilac);
}
.manifesto .process i {
  background: var(--lilac);
}
.manifesto .process i::after {
  background: var(--paper);
  border-color: var(--lilac);
}

/* Keep the named service accents legible against the lighter surface. */
.businesses .detail-content { --accent: var(--gold); }
.advisory .detail-content { --accent: var(--lilac); }
.applications .detail-content { --accent: var(--apricot); }
.research .detail-content { --accent: var(--ice); }
.innovation .detail-content { --accent: var(--rose); }

@media (forced-colors: active) {
  .offerings::before,
  .detail-content::before,
  .approach-content::before,
  body:has(.contact-heading) main > .editorial::before,
body:has(footer a[href$="/privacy/"][aria-current="page"]) main > .editorial::before,
  body:not(:has(footer a[href$="/privacy/"][aria-current="page"])) .page-hero ~ .editorial:nth-of-type(even)::before {
    background: Canvas;
  }
}

/* Let a change in surface color provide the section boundary. */
.manifesto,
.detail-content,
.approach-content,
body:has(.contact-heading) main > header + .editorial,
main > .page-hero + .editorial,
main > .editorial + .closing-surface > .editorial,
.detail-content + .close .close-grid,
.approach-content + .close .close-grid,
body:has(.home-heading) .close-grid,
body:has(.home-heading) .footer-inner {
  border: 0;
}

/* Carry the color of each service from its diagram through to its closing line. */
.businesses, .approach { --accent: var(--gold); --companion: var(--apricot); }
.advisory { --companion: var(--ice); }
.applications, .careers { --accent: var(--apricot); --companion: #ffd7bd; }
.research { --companion: #78a9ff; }
.innovation, .contact { --companion: var(--lilac); }
.about { --accent: var(--lilac); --companion: var(--rose); }
.contact { --accent: var(--ice); }

.detail-head {
  --smooth-spectrum: linear-gradient(106deg, var(--accent), var(--companion));
}
.target-view .close :is(.eyebrow, em) { color: var(--accent, var(--apricot)); }
.page-hero { --smooth-spectrum: linear-gradient(106deg, var(--ice), var(--lilac)); }

.nav-menu > :is(.offering-list, nav) {
  --graphite: 38 38 38;
  --feather: 16px;
  color: var(--copy);
  background: rgb(var(--graphite)) url("/assets/graphics/grain.png?v=456d7d8df4c045db") 0 0 / 144px 144px;
  box-shadow: none;
  /* Extend the graphite beyond the scrollport, leaving text and focus rings crisp. */
  border: 0 solid transparent;
  border-image: radial-gradient(ellipse closest-side,
    rgb(var(--graphite)) 8%, rgb(var(--graphite) / .94) 24%,
    rgb(var(--graphite) / .50) 53%, rgb(var(--graphite) / .08) 82%,
    transparent 100%) 48% / var(--feather) / var(--feather) stretch;
}
.nav-menu [popover] :is(a, button) {
  -webkit-tap-highlight-color: transparent;
}
.nav-menu [popover] :is(a, button):is(:hover, :focus-visible, :active) {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .22em;
}
@media (forced-colors: active) {
  .nav-menu > :is(.offering-list, nav) {
    background: Canvas;
    border: 1px solid CanvasText;
  }
}
::selection { color: #ffffff; background: #0043ce; }

.nav-contact, a.text-link, .editorial a { color: var(--link); }
a.text-link { border-bottom-color: currentColor; }
:is(.nav-contact, a.text-link, .editorial a):hover { color: var(--link-hover); }
:is(.nav-contact, a.text-link, .editorial a):active { color: var(--link-active); }
.card--topline-purple::before { background: var(--accent); }

/* Extend light surfaces behind the full width of their one-pixel top borders. */
body:has(.contact-heading) main > .editorial + .editorial::before,
body:has(footer a[href$="/privacy/"][aria-current="page"]) main > .editorial + .editorial::before {
  inset-block-start: -2px;
}
body:has(.contact-heading) main > .editorial:has(+ .editorial)::before,
body:has(footer a[href$="/privacy/"][aria-current="page"]) main > .editorial:has(+ .editorial)::before {
  inset-block-end: -2px;
}

/* Draw the centered divider above both overlapping light backgrounds. */
body:has(.contact-heading) main > .editorial + .editorial,
body:has(footer a[href$="/privacy/"][aria-current="page"]) main > .editorial + .editorial {
  border-top-color: transparent;
}
body:has(.contact-heading) main > .editorial + .editorial::after,
body:has(footer a[href$="/privacy/"][aria-current="page"]) main > .editorial + .editorial::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
  z-index: 1;
  pointer-events: none;
}
@media (forced-colors: active) {
  body:has(.contact-heading) main > .editorial + .editorial::after,
  body:has(footer a[href$="/privacy/"][aria-current="page"]) main > .editorial + .editorial::after {
    background: CanvasText;
  }
}
