@font-face {
  font-family: "Instrument Sans";
  src: url("./instrument-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("./instrument-sans-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
}

.cg-preview > #preview-content {
  display: grid;
  background: #fff;
}

.cg-hero {
  --ink: #23182c;
  --muted: #584a61;
  --accent: #6024a9;
  --gutter: max(1.125rem, env(safe-area-inset-left), env(safe-area-inset-right));
  --field-pattern: url("./chromagora-tile.png") repeat -8.06px -8.06px / 16.12px 16.12px;
  position: relative;
  isolation: isolate;
  display: grid;
  color: var(--ink);
  background: #fff;
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
  text-align: center;
}

.cg-hero *, .cg-hero *::before, .cg-hero *::after { box-sizing: border-box; }
.cg-hero p, .cg-hero h1 { margin: 0; }

.cg-hero__field,
.cg-hero__canvas,
.cg-hero__field::before,
.cg-hero.is-highlighted .cg-hero__field::after {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
}

.cg-hero__field {
  --cg-field-underlay: inherit;
  inset-block-start: calc(-1 * var(--cg-field-underlay, 80.6px));
  block-size: calc(100% + var(--cg-field-underlay, 80.6px));
  z-index: -1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, #000, rgb(0 0 0 / 54%) 36%, rgb(0 0 0 / 54%) 64%, #000);
}

.cg-hero__field::before {
  content: "";
  background: var(--field-pattern);
  opacity: .052;
}

.cg-hero__canvas { visibility: hidden; }
.cg-hero__canvas.is-painted { visibility: visible; }

@supports (mask-image: radial-gradient(black, transparent)) {
  .cg-hero.is-highlighted .cg-hero__field::after {
    content: "";
    background: var(--field-pattern);
    opacity: .468;
    mask-image: radial-gradient(circle 119.6px at var(--pointer-x) var(--pointer-y),
      #000 0%, rgb(0 0 0 / 70%) 30%, rgb(0 0 0 / 24%) 70%, transparent 100%);
  }
}

.cg-hero__inner {
  display: grid;
  justify-items: center;
  align-content: center;
  inline-size: min(100%, 78rem);
  margin-inline: auto;
  padding: clamp(2rem, 5vh, 4.5rem) var(--gutter);
}

.cg-hero__copy {
  position: relative;
  min-inline-size: 0;
  inline-size: 100%;
}

.cg-hero__wordmark {
  display: block;
  inline-size: clamp(24rem, 87vw, 60rem);
  max-inline-size: 100%;
  block-size: auto;
  margin-block: clamp(.5rem, 2vh, 1.25rem) clamp(1rem, 3vh, 2rem);
}

.cg-hero .cg-hero__audience {
  margin-block-end: clamp(.75rem, 1.4vw, 1.25rem);
  color: var(--muted);
  inline-size: fit-content;
  margin-inline: auto;
  font-size: clamp(1rem, 1.45vw, 1.125rem);
  font-weight: 550;
  line-height: 1.4;
  letter-spacing: .015em;
  text-align: center;
  text-transform: none;
}

.cg-hero h1 {
  font-size: clamp(2.25rem, 5.25vw, 5.125rem);
  font-weight: 550;
  line-height: 1.04;
  letter-spacing: -.035em;
  text-transform: uppercase;
}

.cg-hero__headline-row {
  --cg-word-phase: -1.6s;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: baseline;
}

.cg-hero__headline-row:nth-child(2) { --cg-word-phase: -1.3s; }
.cg-hero__headline-row:nth-child(3) { --cg-word-phase: -1.05s; }
.cg-hero__anchor {
  color: #000;
  text-align: end;
}

.cg-hero__carousel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  container-type: inline-size;
  align-items: baseline;
  --cg-word-feather: .55em;
  font-family: inherit;
  font-style: italic;
  font-weight: 500;
  font-synthesis: none;
  font-size: min(.96em, 8.8vw);
  line-height: 1.14;
  letter-spacing: -.01em;
  text-transform: lowercase;
  white-space: nowrap;
  text-align: start;
}

.cg-hero__word {
  --cg-descender-space: .065em;
  grid-area: 1 / 1;
  margin-block-end: calc(-1 * var(--cg-descender-space));
  inline-size: max-content;
  /* Size every word against the longest word and its fade edges. */
  font-size: min(1em, 11.6cqi);
  padding-inline: var(--cg-word-feather);
  overflow: hidden;
}

.cg-hero__ink {
  display: block;
  padding-inline: .2em;
  /* Keep lowercase descenders inside the moving mask. */
  padding-block-end: var(--cg-descender-space);
  color: var(--accent);
}

.cg-hero__word:nth-child(n+2) { display: none; }
.cg-hero__word:nth-child(2) { --cg-word-index: 1; }
.cg-hero__word:nth-child(3) { --cg-word-index: 2; }
.cg-hero__word:nth-child(4) { --cg-word-index: 3; }
.cg-hero__word:nth-child(5) { --cg-word-index: 4; }
.cg-hero__word:nth-child(6) { --cg-word-index: 5; }
.cg-hero__word:nth-child(7) { --cg-word-index: 6; }

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .cg-hero__ink {
    /* The official wordmark's SVG gradient stops, projected onto each word. */
    --cg-logo-stops:
      #4e05b9 0%, #4f05bb 1.5291%, #5e0ad0 9.9388%, #6d17db 19.8777%,
      #7a28e7 30.581%, #9141f0 42.0489%, #a75cf6 54.4343%, #be7ef9 66.5138%,
      #ce99fa 77.9817%, #d6aaf6 88.2263%, #dbb2f6 94.8012%, #deb7f6 100%;
    background-image: linear-gradient(179.27996deg, var(--cg-logo-stops));
    background-image: linear-gradient(179.27996deg in srgb, var(--cg-logo-stops));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* Seven four-second slots. Each pass has one second on either edge and two at rest. */
@keyframes cg-hero-word-pass {
  0% {
    opacity: 0;
    transform: translateX(calc(-100% - var(--cg-word-feather)));
    mask-position: 0% 50%;
  }
  3.571429%, 10.714286% {
    opacity: 1;
    transform: translateX(0);
    mask-position: 50% 50%;
  }
  14.285714%, 100% {
    opacity: 0;
    transform: translateX(calc(100% + var(--cg-word-feather)));
    mask-position: 100% 50%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cg-hero[data-word-rotation] .cg-hero__word {
    display: block;
    /* The ink clears a transparent margin before crossing the clipping edge. */
    mask-image: linear-gradient(to right,
      transparent 0 .08em, rgb(0 0 0 / 6%) .16em, rgb(0 0 0 / 50%) .31em,
      rgb(0 0 0 / 94%) .46em, #000 var(--cg-word-feather),
      #000 calc(100% - var(--cg-word-feather)), rgb(0 0 0 / 94%) calc(100% - .46em),
      rgb(0 0 0 / 50%) calc(100% - .31em), rgb(0 0 0 / 6%) calc(100% - .16em),
      transparent calc(100% - .08em) 100%);
  }

  .cg-hero[data-word-rotation] .cg-hero__ink {
    /* Each soft edge spans more than a whole word. At rest only the solid center is visible. */
    mask-image: linear-gradient(to right,
      transparent 0 18%, rgb(0 0 0 / 4%) 22%, rgb(0 0 0 / 20%) 26%,
      rgb(0 0 0 / 50%) 29%, rgb(0 0 0 / 80%) 32%, rgb(0 0 0 / 96%) 36%, #000 40% 60%,
      rgb(0 0 0 / 96%) 64%, rgb(0 0 0 / 80%) 68%, rgb(0 0 0 / 50%) 71%,
      rgb(0 0 0 / 20%) 74%, rgb(0 0 0 / 4%) 78%, transparent 82% 100%);
    mask-size: 600% 100%;
    mask-repeat: no-repeat;
    animation: cg-hero-word-pass 28s cubic-bezier(.45, 0, .55, 1) infinite both;
    animation-delay: calc(var(--cg-word-phase) + var(--cg-word-index, 0) * 4s);
  }

  .cg-hero[data-word-rotation-paused] .cg-hero__ink { animation-play-state: paused; }
}

@media (forced-colors: active) {
  .cg-hero__ink {
    color: CanvasText;
    background: none;
  }
}

.cg-hero .cg-hero__description {
  max-inline-size: 36rem;
  margin-inline: auto;
  margin-block-start: clamp(1rem, 2vw, 1.65rem);
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.55vw, 1.3125rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.cg-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem clamp(.875rem, 2vw, 1.75rem);
  margin-block-start: clamp(.875rem, 2vw, 1.5rem);
}

.cg-hero__actions a {
  display: inline-flex;
  align-items: center;
  min-block-size: 3rem;
  border-radius: .375rem;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
}

.cg-hero__primary {
  padding: .75rem 1.25rem;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
}

.cg-hero__primary:hover { background: #4d188d; }

.cg-hero__secondary {
  padding: .5rem .25rem;
  color: var(--ink);
  text-decoration-color: #b9a4c9;
  text-decoration-thickness: 1px;
  text-underline-offset: .27em;
}

.cg-hero__secondary:hover { color: var(--accent); text-decoration-color: currentColor; }
.cg-hero__actions a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

@media (max-width: 40rem) {
  .cg-hero__inner { padding-block: clamp(1.25rem, 4vh, 2.5rem); }
  .cg-hero h1 { font-size: clamp(1.9rem, 10vw, 3.5rem); }
  .cg-hero__carousel { font-size: min(.96em, 7.2vw); }
}

@media (max-width: 40rem) and (min-height: 43.75rem) {
  .cg-hero__inner { padding-block-end: min(13vh, 7rem); }
}

@media (max-width: 23rem) {
  .cg-hero__actions { column-gap: .625rem; }
  .cg-hero__primary { padding-inline: .875rem; }
}

/* Services overview */
.cg-services-hero .cg-hero__inner {
  padding-block: clamp(3.5rem, 8vw, 7.25rem) clamp(3.5rem, 7.5vw, 6.5rem);
}
.cg-services-hero h1 {
  color: #17131a;
  font-size: clamp(2.25rem, 7.05vw, 7rem);
  line-height: .98;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.cg-services-headline { display: block; }
.cg-services-hero .cg-hero__ink {
  --cg-logo-stops: #4e05b9 0%, #6d17db 55%, #8d4cd2 100%;
  padding-inline: .07em;
  font-size: .98em;
  font-style: italic;
  font-weight: 500;
  line-height: 1.12;
  text-transform: none;
}
.cg-services-hero .cg-hero__description { max-inline-size: 34rem; }
.cg-services-hero .cg-hero__actions { margin-block-start: clamp(1.35rem, 2.6vw, 2rem); }
.cg-services-hero .cg-hero__primary { gap: .65rem; }
.cg-services-hero .cg-hero__primary .cg-arrow { transform: rotate(90deg); }

.ed-service-directory {
  padding-block: clamp(3rem, 6vw, 5.5rem);
  border-block: 1px solid #e7ddec;
  background: linear-gradient(180deg, #f8f4fb, #f1ebf7);
}
.ed-service-directory h2 {
  margin-block-end: clamp(1.5rem, 3vw, 2.5rem);
  scroll-margin-block-start: 1.5rem;
}
.ed-service-directory h2:focus-visible { outline: 2px solid var(--cg-ink); outline-offset: .4rem; }
.ed-service-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.8rem, 1.6vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.ed-service-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
  block-size: 100%;
  padding: clamp(1.25rem, 2.2vw, 2.1rem);
  border: 1px solid #dfd3e8;
  border-radius: .9rem;
  background: #fff;
  text-decoration: none;
}
.ed-service-card:is(:hover, :focus-visible) { border-color: #9267b9; }
.ed-service-card-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: .75rem;
}
.ed-service-card h3 {
  color: #23182c;
  font-size: clamp(1.4rem, 2.05vw, 2.05rem);
  line-height: 1.12;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.ed-service-card-icon {
  display: grid;
  place-items: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border: 1px solid #dfd3e8;
  border-radius: 50%;
  background: #faf7fc;
}
.ed-service-card:is(:hover, :focus-visible) .ed-service-card-icon { background: #f0e6f7; }
.ed-service-card .ed-service-fit {
  padding-block-start: 1rem;
  border-block-start: 1px solid #e7ddec;
  color: #5a4866;
  font-size: .9375rem;
}
@media (max-width: 57rem) {
  .ed-service-cards { grid-template-columns: 1fr; }
  .ed-service-card p { max-inline-size: 65ch; }
  .ed-service-card .ed-service-fit { max-inline-size: none; }
}
