/* HOME PAGE (index.html). Loads after base.css. */

.section__header {
  display: grid;
  justify-items: center;
  text-align: center;
}

.section__title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--charcoal);
  text-transform: uppercase;
}

.section__para {
  margin: 12px 0 24px;
  font-size: 1.5rem;
  color: var(--charcoal);
  line-height: 1.5;
}

/* LANDING */

#landing {
  display: flow-root;
  min-height: calc(100vh - var(--marquee-overlap));
  padding-top: 80px;
  position: relative;
}

/* The hero photo runs under the top marquee and is cut along its wave. */
.hero__header {
  --hero-word-duration: 1.5s;
  --hero-moodboard-delay: calc(var(--hero-word-duration) * 3);

  position: relative;
  height: calc(100vh - 80px);
  margin-bottom: calc(var(--marquee-overlap) * -1);
  padding-bottom: var(--marquee-overlap);
  overflow: hidden;
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100%
      calc(100% - var(--marquee-height) + 1px) no-repeat,
    var(--marquee-mask-above) bottom / 100% var(--marquee-height) no-repeat;
  mask:
    linear-gradient(#000 0 0) top / 100%
      calc(100% - var(--marquee-height) + 1px) no-repeat,
    var(--marquee-mask-above) bottom / 100% var(--marquee-height) no-repeat;
  background-image: url("../assets/images/hero-background.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Words and moodboard share the area above the marquee, so nothing is
   centered behind (or cut off by) the wave. */
.hero-word-sequence,
.hero-moodboard__stage {
  position: absolute;
  top: 0;
  right: 0;
  bottom: var(--marquee-height);
  left: 0;
}

.hero-word-sequence {
  overflow: hidden;
}

.hero-word {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(90%, 60rem);
  color: var(--charcoal);
  font-size: clamp(2.5rem, 7vw, 7rem);
  font-weight: 500;
  /* A roomy line box plus padding keeps descenders (g, y) inside the element;
     iOS Safari clips filtered, animated text to its box. The word is centered
     on its box, so this doesn't move it. */
  line-height: 1.3;
  padding-top: 0.1em;
  padding-bottom: 0.1em;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.65);
  animation: hero-word-cycle var(--hero-word-duration)
    cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-word--2 {
  animation-delay: var(--hero-word-duration);
}

.hero-word--3 {
  animation-delay: calc(var(--hero-word-duration) * 2);
}

/* MOODBOARD: the grid and copy arrive together after the words; the pieces
   then follow one at a time (see .moodboard-piece). */
.hero-moodboard {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  animation: hero-moodboard-fade 700ms ease-out var(--hero-moodboard-delay)
    both;
}

.hero-moodboard::before {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  content: "";
  background-image:
    linear-gradient(to right, rgb(51 51 51 / 0.16) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(51 51 51 / 0.16) 1px, transparent 1px);
  background-position: center top;
  background-size: 4rem 4rem;
}

/* --u scales every piece with the stage: width-led, but capped by height so
   short screens shrink the board instead of pushing it into the marquee. */
.hero-moodboard__stage {
  --u: min(1cqw, 2.2cqh);

  container: moodboard / size;
  animation: hero-moodboard-settle 900ms cubic-bezier(0.16, 1, 0.3, 1)
    var(--hero-moodboard-delay) both;
}

.hero-moodboard__content {
  position: absolute;
  z-index: 2;
  top: 60%;
  left: 50%;
  display: grid;
  justify-items: center;
  width: max-content;
  max-width: 100%;
  color: var(--charcoal);
  text-align: center;
  transform: translate(-50%, -50%);
}

/* Extra word spacing keeps the script headline readable. */
.hero-moodboard__title {
  font-family: "livermore-script-atf", cursive;
  font-size: calc(var(--u) * 6.2);
  font-weight: 400;
  line-height: 1.05;
  word-spacing: 0.2em;
  /* Room for the script's descenders inside the box (see .hero-word); the
     negative margin cancels it so the layout doesn't change. */
  padding-top: 0.15em;
  padding-bottom: 0.15em;
  margin-top: -0.15em;
  margin-bottom: -0.15em;
}

/* Font size and line height are set here because the global p rule sets them. */
.hero-moodboard__subtitle {
  margin-top: max(0.625rem, var(--u) * 1.6);
  font-size: max(1rem, var(--u) * 1.9);
  line-height: 1.3;
  font-weight: 500;
}

.hero-moodboard__cta {
  margin-top: max(1.25rem, var(--u) * 2.4);
  padding: 10px 44px;
  font-size: 15px;
}

/* Desktop boards: the button grows with the headline (never below the base size). */
@container moodboard (min-width: 1081px) {
  .hero-moodboard__cta {
    padding: max(10px, var(--u) * 0.85) max(44px, var(--u) * 3.6);
    font-size: max(15px, var(--u) * 1.3);
  }
}

.moodboard-piece {
  /* Arrival slot (see the stagger rules below). */
  --piece-order: 0;

  position: absolute;
  z-index: 1;
  /* Pieces arrive one at a time after the copy, top to bottom and left to
     right. translate/scale compose with each piece's own rotate transform. */
  animation: moodboard-piece-in 600ms cubic-bezier(0.16, 1, 0.3, 1)
    calc(
      var(--hero-moodboard-delay) + 500ms + var(--piece-order) * 250ms
    )
    both;
}

.moodboard-piece--est {
  --piece-order: 1;
}

.moodboard-piece--photos {
  --piece-order: 2;
}

.moodboard-piece--pattern {
  --piece-order: 3;
}

.moodboard-piece--swatches {
  --piece-order: 4;
}

.moodboard-piece--note {
  --piece-order: 5;
}

/* The pattern scrap is hidden on smaller boards; close up its slot. */
@container moodboard (max-width: 1080px) {
  .moodboard-piece--swatches {
    --piece-order: 3;
  }

  .moodboard-piece--note {
    --piece-order: 4;
  }
}

.moodboard-piece__paper,
.moodboard-piece__photo {
  display: block;
  width: 100%;
  height: auto;
}

.moodboard-piece__paper {
  filter: drop-shadow(0 0.3rem 0.5rem rgb(51 51 51 / 0.18));
}

/* Handwritten notes use the same face as the Bubba's case study captions. */
.moodboard-piece__script,
.moodboard-piece__script li {
  font-family: "adobe-handwriting-ernie", cursive;
}

.moodboard-piece__script {
  position: absolute;
  color: var(--charcoal);
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
}

.moodboard-piece__pin {
  position: absolute;
  z-index: 2;
  width: calc(var(--u) * 1.9);
  height: auto;
  filter: drop-shadow(0.1rem 0.2rem 0.15rem rgb(51 51 51 / 0.35));
}

.moodboard-piece--kraft {
  top: 9%;
  left: 16%;
  width: calc(var(--u) * 23);
  transform: rotate(-14deg);
}

/* Stretched wider than the image's ratio; the height stays what a 19u-wide
   scrap would have, so the paper reads longer without getting taller. */
.moodboard-piece--kraft .moodboard-piece__paper {
  height: calc(var(--u) * 7.95);
  object-fit: fill;
}

.moodboard-piece--kraft .moodboard-piece__script {
  top: 50%;
  left: 55%;
  font-size: calc(var(--u) * 2.1);
  transform: translate(-50%, -50%);
}

/* Net ~48deg clockwise (the scrap is at -14deg) so the needle points
   down-left, as in the mockup. */
.moodboard-piece--kraft .moodboard-piece__pin {
  top: calc(var(--u) * -1.6);
  left: 46%;
  transform: rotate(62deg);
}

.moodboard-piece--est {
  top: 9%;
  left: 61%;
  width: calc(var(--u) * 18.5);
  transform: rotate(9deg);
}

.moodboard-piece--est .moodboard-piece__paper {
  filter: none;
  opacity: 0.85;
}

.moodboard-piece--est .moodboard-piece__script {
  top: 42%;
  left: 54%;
  font-size: calc(var(--u) * 2.4);
  transform: translate(-50%, -50%) rotate(-4deg);
}

.moodboard-piece--photos {
  top: 39%;
  left: 8%;
  width: calc(var(--u) * 20);
  height: calc(var(--u) * 20);
}

.moodboard-piece__photo {
  position: absolute;
  border: calc(var(--u) * 0.4) solid #fff;
  box-shadow: 0 0.3rem 0.8rem rgb(51 51 51 / 0.25);
}

.moodboard-piece__photo--back {
  top: calc(var(--u) * 1.6);
  left: calc(var(--u) * -0.6);
  width: calc(var(--u) * 12.5);
  transform: rotate(4deg);
}

.moodboard-piece__photo--front {
  top: 0;
  left: calc(var(--u) * 5);
  width: calc(var(--u) * 13);
  transform: rotate(-12deg);
}

.moodboard-piece--photos .moodboard-piece__pin {
  top: calc(var(--u) * -0.9);
  left: calc(var(--u) * 7.6);
}

.moodboard-piece--pattern {
  top: 31%;
  left: 77%;
  width: calc(var(--u) * 15);
  transform: rotate(9deg);
}

.moodboard-piece__clip {
  position: absolute;
  z-index: 2;
  top: calc(var(--u) * -3.2);
  left: 38%;
  width: calc(var(--u) * 5.5);
  height: auto;
  filter: drop-shadow(0.1rem 0.25rem 0.2rem rgb(51 51 51 / 0.3));
  /* The scrap's torn top edge runs at about -0.6deg in its image, so the
     same tilt keeps the clip's jaw parallel to the paper's edge. */
  transform: rotate(-0.6deg);
}

/* Bottom-anchored pieces stay clear of the marquee at any stage height. */
.moodboard-piece--note {
  right: 9%;
  bottom: calc(var(--u) * 2);
  width: calc(var(--u) * 19);
  transform: rotate(12deg);
}

.moodboard-piece--note .moodboard-piece__script {
  top: 26%;
  left: 14%;
  font-size: calc(var(--u) * 2.3);
  line-height: 1.55;
}

.moodboard-piece--swatches {
  bottom: 5%;
  left: 12.5%;
  display: flex;
  gap: calc(var(--u) * 1.1);
}

.moodboard-swatch {
  width: calc(var(--u) * 5.5);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 0.2rem 0.5rem rgb(51 51 51 / 0.15);
}

.moodboard-swatch--clementine {
  background-color: var(--lightclementine);
}

.moodboard-swatch--blush {
  background-color: var(--lightblush);
}

.moodboard-swatch--goldenhour {
  background-color: var(--lightgoldenhour);
}

.moodboard-swatch--linen {
  background-color: var(--linen);
}

/* Narrow boards (phones): the copy takes the middle, pieces frame it
   top and bottom, and the clipped scrap is dropped for room. */
@container moodboard (max-width: 640px) {
  .hero-moodboard__content {
    /* Center the headline on tall phones; ease back toward 49% on short
       ones so the button stays clear of the photos and sticky note. */
    top: calc(49% + clamp(0px, (100cqh - 500px) * 0.25, 6cqh));
  }

  .hero-moodboard__title {
    font-size: min(calc(var(--u) * 10.5), 9cqh);
  }

  .hero-moodboard__subtitle {
    font-size: 1.0625rem;
  }

  .hero-moodboard__cta {
    padding: 8px 36px;
    font-size: 14px;
  }

  .moodboard-piece--kraft {
    top: 7%;
    left: 4%;
    width: calc(var(--u) * 40);
    transform: rotate(-9deg);
  }

  .moodboard-piece--kraft .moodboard-piece__paper {
    height: calc(var(--u) * 14.2);
  }

  .moodboard-piece--kraft .moodboard-piece__script {
    font-size: calc(var(--u) * 3.5);
  }

  .moodboard-piece--kraft .moodboard-piece__pin {
    top: calc(var(--u) * -2.6);
    width: calc(var(--u) * 3.6);
  }

  .moodboard-piece--est {
    top: 5%;
    right: 3%;
    left: auto;
    width: calc(var(--u) * 33);
  }

  .moodboard-piece--est .moodboard-piece__script {
    font-size: calc(var(--u) * 4.4);
  }

  .moodboard-piece--photos {
    top: auto;
    bottom: 3%;
    left: 3%;
    width: calc(var(--u) * 30);
    height: calc(var(--u) * 30);
  }

  .moodboard-piece__photo {
    border-width: calc(var(--u) * 0.8);
  }

  .moodboard-piece__photo--back {
    top: calc(var(--u) * 3);
    width: calc(var(--u) * 18);
  }

  .moodboard-piece__photo--front {
    left: calc(var(--u) * 8);
    width: calc(var(--u) * 19);
  }

  .moodboard-piece--photos .moodboard-piece__pin {
    top: calc(var(--u) * -1.6);
    left: calc(var(--u) * 12);
    width: calc(var(--u) * 3.6);
  }

  .moodboard-piece--pattern {
    display: none;
  }

  .moodboard-piece--note {
    right: 3%;
    bottom: calc(var(--u) * 3);
    width: calc(var(--u) * 28);
  }

  .moodboard-piece--note .moodboard-piece__script {
    font-size: calc(var(--u) * 3.4);
  }

  .moodboard-piece--swatches {
    bottom: 4%;
    left: 50%;
    gap: calc(var(--u) * 1.4);
    transform: translateX(-50%);
  }

  .moodboard-swatch {
    width: calc(var(--u) * 6.5);
  }
}

/* Tablets (641-1080px, where the navbar is collapsed): the headline holds at
   its 1080px size (capped on short screens), and phone-style pieces frame it
   above and below. The clipped scrap is dropped, as on phones. */
@container moodboard (min-width: 641px) and (max-width: 1080px) {
  .hero-moodboard__content {
    --u: min(1cqw, 1.2cqh);
  }

  /* Pieces get a larger unit than the copy so they read at phone-like scale. */
  .moodboard-piece {
    --u: min(1.4cqw, 1.6cqh);
  }

  .hero-moodboard__content {
    top: 56%;
  }

  .hero-moodboard__title {
    font-size: min(4.2rem, 12cqh);
  }

  .hero-moodboard__subtitle {
    font-size: max(1.0625rem, var(--u) * 2.6);
  }

  .moodboard-piece--kraft {
    top: 5%;
    left: 4%;
    width: calc(var(--u) * 24);
    transform: rotate(-10deg);
  }

  .moodboard-piece--kraft .moodboard-piece__paper {
    height: calc(var(--u) * 8.3);
  }

  .moodboard-piece--kraft .moodboard-piece__script {
    font-size: calc(var(--u) * 2.1);
  }

  .moodboard-piece--kraft .moodboard-piece__pin {
    top: calc(var(--u) * -1.6);
    width: calc(var(--u) * 2.2);
  }

  .moodboard-piece--est {
    top: 5%;
    right: 4%;
    left: auto;
    width: calc(var(--u) * 20);
  }

  .moodboard-piece--est .moodboard-piece__script {
    font-size: calc(var(--u) * 2.6);
  }

  .moodboard-piece--photos {
    top: auto;
    bottom: 3%;
    left: 4%;
    width: calc(var(--u) * 18);
    height: calc(var(--u) * 18);
  }

  .moodboard-piece__photo {
    border-width: calc(var(--u) * 0.5);
  }

  .moodboard-piece__photo--back {
    top: calc(var(--u) * 1.8);
    width: calc(var(--u) * 11);
  }

  .moodboard-piece__photo--front {
    left: calc(var(--u) * 4.8);
    width: calc(var(--u) * 11.4);
  }

  .moodboard-piece--photos .moodboard-piece__pin {
    top: calc(var(--u) * -1);
    left: calc(var(--u) * 7.2);
    width: calc(var(--u) * 2.2);
  }

  .moodboard-piece--pattern {
    display: none;
  }

  .moodboard-piece--note {
    right: 4%;
    bottom: calc(var(--u) * 2.5);
    width: calc(var(--u) * 17);
  }

  .moodboard-piece--note .moodboard-piece__script {
    font-size: calc(var(--u) * 2.1);
  }

  .moodboard-piece--swatches {
    bottom: 4%;
    left: 50%;
    gap: calc(var(--u) * 0.9);
    transform: translateX(-50%);
  }

  .moodboard-swatch {
    width: calc(var(--u) * 4);
  }
}

/*
  Browsers without container queries (Safari before 16) ignore every
  @container block above and can’t resolve cqw/cqh, so the pieces fell back
  to their image size. Here --cqw/--cqh are 1% of the stage, worked out from
  the viewport (the stage is the hero minus the navbar and the marquee), and
  each @container block is repeated as the matching @media query.
*/
@supports not (container-type: size) {
  .hero-moodboard__stage {
    --cqw: 1vw;
    --cqh: calc((100vh - 80px - var(--marquee-height)) / 100);
    --u: min(var(--cqw), var(--cqh) * 2.2);
  }

  /* No aspect-ratio before Safari 15: keep the swatches round. */
  .moodboard-swatch {
    height: calc(var(--u) * 5.5);
  }

  @media (min-width: 1081px) {
    .hero-moodboard__cta {
      padding: max(10px, var(--u) * 0.85) max(44px, var(--u) * 3.6);
      font-size: max(15px, var(--u) * 1.3);
    }
  }

  @media (max-width: 1080px) {
    .moodboard-piece--swatches {
      --piece-order: 3;
    }

    .moodboard-piece--note {
      --piece-order: 4;
    }
  }

  @media (max-width: 640px) {
    .hero-moodboard__content {
      /* Center the headline on tall phones; ease back toward 49% on short
         ones so the button stays clear of the photos and sticky note. */
      top: calc(49% + clamp(0px, (var(--cqh) * 100 - 500px) * 0.25, var(--cqh) * 6));
    }

    .hero-moodboard__title {
      font-size: min(calc(var(--u) * 10.5), var(--cqh) * 9);
    }

    .hero-moodboard__subtitle {
      font-size: 1.0625rem;
    }

    .hero-moodboard__cta {
      padding: 8px 36px;
      font-size: 14px;
    }

    .moodboard-piece--kraft {
      top: 7%;
      left: 4%;
      width: calc(var(--u) * 40);
      transform: rotate(-9deg);
    }

    .moodboard-piece--kraft .moodboard-piece__paper {
      height: calc(var(--u) * 14.2);
    }

    .moodboard-piece--kraft .moodboard-piece__script {
      font-size: calc(var(--u) * 3.5);
    }

    .moodboard-piece--kraft .moodboard-piece__pin {
      top: calc(var(--u) * -2.6);
      width: calc(var(--u) * 3.6);
    }

    .moodboard-piece--est {
      top: 5%;
      right: 3%;
      left: auto;
      width: calc(var(--u) * 33);
    }

    .moodboard-piece--est .moodboard-piece__script {
      font-size: calc(var(--u) * 4.4);
    }

    .moodboard-piece--photos {
      top: auto;
      bottom: 3%;
      left: 3%;
      width: calc(var(--u) * 30);
      height: calc(var(--u) * 30);
    }

    .moodboard-piece__photo {
      border-width: calc(var(--u) * 0.8);
    }

    .moodboard-piece__photo--back {
      top: calc(var(--u) * 3);
      width: calc(var(--u) * 18);
    }

    .moodboard-piece__photo--front {
      left: calc(var(--u) * 8);
      width: calc(var(--u) * 19);
    }

    .moodboard-piece--photos .moodboard-piece__pin {
      top: calc(var(--u) * -1.6);
      left: calc(var(--u) * 12);
      width: calc(var(--u) * 3.6);
    }

    .moodboard-piece--pattern {
      display: none;
    }

    .moodboard-piece--note {
      right: 3%;
      bottom: calc(var(--u) * 3);
      width: calc(var(--u) * 28);
    }

    .moodboard-piece--note .moodboard-piece__script {
      font-size: calc(var(--u) * 3.4);
    }

    .moodboard-piece--swatches {
      bottom: 4%;
      left: 50%;
      gap: calc(var(--u) * 1.4);
      transform: translateX(-50%);
    }

    .moodboard-swatch {
      width: calc(var(--u) * 6.5);
    }
  }

  @media (min-width: 641px) and (max-width: 1080px) {
    .hero-moodboard__content {
      --u: min(var(--cqw), var(--cqh) * 1.2);
    }

    /* Pieces get a larger unit than the copy so they read at phone-like scale. */
    .moodboard-piece {
      --u: min(var(--cqw) * 1.4, var(--cqh) * 1.6);
    }

    .hero-moodboard__content {
      top: 56%;
    }

    .hero-moodboard__title {
      font-size: min(4.2rem, var(--cqh) * 12);
    }

    .hero-moodboard__subtitle {
      font-size: max(1.0625rem, var(--u) * 2.6);
    }

    .moodboard-piece--kraft {
      top: 5%;
      left: 4%;
      width: calc(var(--u) * 24);
      transform: rotate(-10deg);
    }

    .moodboard-piece--kraft .moodboard-piece__paper {
      height: calc(var(--u) * 8.3);
    }

    .moodboard-piece--kraft .moodboard-piece__script {
      font-size: calc(var(--u) * 2.1);
    }

    .moodboard-piece--kraft .moodboard-piece__pin {
      top: calc(var(--u) * -1.6);
      width: calc(var(--u) * 2.2);
    }

    .moodboard-piece--est {
      top: 5%;
      right: 4%;
      left: auto;
      width: calc(var(--u) * 20);
    }

    .moodboard-piece--est .moodboard-piece__script {
      font-size: calc(var(--u) * 2.6);
    }

    .moodboard-piece--photos {
      top: auto;
      bottom: 3%;
      left: 4%;
      width: calc(var(--u) * 18);
      height: calc(var(--u) * 18);
    }

    .moodboard-piece__photo {
      border-width: calc(var(--u) * 0.5);
    }

    .moodboard-piece__photo--back {
      top: calc(var(--u) * 1.8);
      width: calc(var(--u) * 11);
    }

    .moodboard-piece__photo--front {
      left: calc(var(--u) * 4.8);
      width: calc(var(--u) * 11.4);
    }

    .moodboard-piece--photos .moodboard-piece__pin {
      top: calc(var(--u) * -1);
      left: calc(var(--u) * 7.2);
      width: calc(var(--u) * 2.2);
    }

    .moodboard-piece--pattern {
      display: none;
    }

    .moodboard-piece--note {
      right: 4%;
      bottom: calc(var(--u) * 2.5);
      width: calc(var(--u) * 17);
    }

    .moodboard-piece--note .moodboard-piece__script {
      font-size: calc(var(--u) * 2.1);
    }

    .moodboard-piece--swatches {
      bottom: 4%;
      left: 50%;
      gap: calc(var(--u) * 0.9);
      transform: translateX(-50%);
    }

    .moodboard-swatch {
      width: calc(var(--u) * 4);
    }
  }

  @media (max-width: 640px) {
    .moodboard-swatch {
      height: calc(var(--u) * 6.5);
    }
  }

  @media (min-width: 641px) and (max-width: 1080px) {
    .moodboard-swatch {
      height: calc(var(--u) * 4);
    }
  }
}

/* Let #about start at the top of the marquee so it can fill below the wave. */
.marquee--top {
  margin-bottom: calc(var(--marquee-height) * -1);
}

/* ABOUT */

#case-studies,
#capabilities,
#street-cred,
#contact {
  /* Moves each heading block down: space comes out from under the heading
     and is added above it, so the section's height doesn't change. */
  --section-shift: 1.5rem;

  background-color: var(--linen);
}

:is(#case-studies, #capabilities, #street-cred, #contact) .section__header {
  margin-top: var(--section-shift);
  margin-bottom: calc(var(--section-shift) * -1);
}

/* Bottom padding clears the half of the marquee that overlaps this section
   (matches the About CTA and case study endings). */
#contact > .container {
  padding-bottom: calc(clamp(2.5rem, 5vw, 4rem) + var(--marquee-overlap));
}

#about {
  min-height: 80vh;
  position: relative;
  z-index: 1;
  padding-top: var(--marquee-height);
  background-image: url("../assets/images/about-background.webp");
  -webkit-mask:
    var(--marquee-mask-below) top / 100% var(--marquee-height) no-repeat,
    linear-gradient(#000 0 0) bottom / 100%
      calc(100% - var(--marquee-height) + 1px) no-repeat;
  mask:
    var(--marquee-mask-below) top / 100% var(--marquee-height) no-repeat,
    linear-gradient(#000 0 0) bottom / 100%
      calc(100% - var(--marquee-height) + 1px) no-repeat;
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
}

/* No bottom padding here so the row's own padding sets the space below the card. */
.about__container {
  padding-bottom: 0;
}

.about__container,
.about__row {
  min-height: inherit;
}

.about__row {
  display: grid;
  min-height: calc(80vh - 3.5rem);
  align-items: end;
  justify-items: end;
  padding-top: 3rem;
  padding-bottom: 5.75rem;
}

/*
 * Everything inside the card is sized in cqi (1% of the card's width),
 * so the card keeps the exact same layout at every screen size.
 */
.about-card {
  container-type: inline-size;
  display: block;
  width: min(26rem, 100%);
  aspect-ratio: 15 / 11;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 1000px;
}

.about-card__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 600ms ease;
}

.about-card.is-flipped .about-card__inner {
  transform: rotateY(180deg);
}

.about-card__face {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--charcoal);
  border-radius: 4.8cqi;
  color: var(--charcoal);
  background-color: var(--clementine);
  text-align: left;
  white-space: nowrap;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.about-card__face--back {
  padding: 10.6cqi 10.75cqi 0;
  white-space: normal;
  transform: rotateY(180deg);
}

.about-card__intro {
  position: absolute;
  top: 9.65cqi;
  left: 49.15cqi;
  font-size: 4.05cqi;
  font-weight: 500;
  line-height: 1.14;
}

.about-card__intro-line,
.about-card__title-line {
  display: block;
}

/* Stagger the intro lines to echo the slant of the italic title. */
.about-card__intro-line:nth-child(1) {
  padding-left: 0.45em;
}

.about-card__intro-line:nth-child(2) {
  padding-left: 0.23em;
}

.about-card__title {
  position: absolute;
  top: 7.6cqi;
  left: 0;
  color: var(--goldenhour);
  font-size: 19.9cqi;
  font-style: italic;
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.about-card__title-line:nth-child(1) {
  padding-left: 14.2cqi;
}

.about-card__title-line:nth-child(2) {
  padding-left: 15.9cqi;
}

.about-card__title-line:nth-child(3) {
  padding-left: 8.8cqi;
}

.about-card__star {
  position: relative;
  top: -0.24em;
  display: inline-block;
  width: 14.75cqi;
  font-size: 0.68em;
  letter-spacing: 0;
}

.about-card__footer {
  position: absolute;
  top: 50.45cqi;
  left: 60.3cqi;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.6cqi;
  width: 23.5cqi;
  font-size: 4.3cqi;
  font-weight: 700;
  line-height: 1;
}

.about-card__prompt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.2cqi;
  width: 100%;
  height: 5.15cqi;
  color: var(--charcoal);
  font-size: 2.4cqi;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  background-color: var(--lightgoldenhour);
  border: 1px solid var(--charcoal);
  border-radius: 999px;
  transition:
    transform 220ms ease-out,
    background-color 180ms ease;
}

.about-card__arrow {
  width: 3.6cqi;
  height: auto;
  transition: transform 220ms ease-out;
}

/* The prompt is a decorative span inside the card button, so it only reacts to
   the pointer (it can't take keyboard focus itself). */
.about-card__prompt:hover .about-card__arrow {
  transform: translateX(1cqi);
}

.about-card__prompt:hover {
  background-color: var(--goldenhour);
  transform: scale(1.07);
}

.about-card__prompt:active {
  background-color: var(--button-pressed);
  transform: scale(0.96);
  transition-duration: 80ms;
}

.about-card__back-title {
  display: block;
  max-width: 66cqi;
  color: var(--linen);
  font-size: 6.6cqi;
  font-weight: 700;
  line-height: 1.04;
}

.about-card__copy {
  display: block;
  margin-top: 3.9cqi;
  color: var(--charcoal);
  font-size: 3.975cqi;
  font-weight: 500;
  line-height: 1.37;
}

/*
  Without container queries (Safari before 16) the cqi sizes above are
  dropped. --cqi is 1% of the card's width, min(26rem, 100% of the row), with
  the row being the viewport less 3rem. The height stands in for
  aspect-ratio, which Safari only has from 15.
*/
@supports not (container-type: inline-size) {
  .about-card {
    --cqi: calc(min(26rem, 100vw - 3rem) / 100);

    height: calc(var(--cqi) * 100 * 11 / 15);
  }

  .about-card__face {
    border-radius: calc(var(--cqi) * 4.8);
  }

  .about-card__face--back {
    padding: calc(var(--cqi) * 10.6) calc(var(--cqi) * 10.75) 0;
  }

  .about-card__intro {
    top: calc(var(--cqi) * 9.65);
    left: calc(var(--cqi) * 49.15);
    font-size: calc(var(--cqi) * 4.05);
  }

  .about-card__title {
    top: calc(var(--cqi) * 7.6);
    font-size: calc(var(--cqi) * 19.9);
  }

  .about-card__title-line:nth-child(1) {
    padding-left: calc(var(--cqi) * 14.2);
  }

  .about-card__title-line:nth-child(2) {
    padding-left: calc(var(--cqi) * 15.9);
  }

  .about-card__title-line:nth-child(3) {
    padding-left: calc(var(--cqi) * 8.8);
  }

  .about-card__star {
    width: calc(var(--cqi) * 14.75);
  }

  .about-card__footer {
    top: calc(var(--cqi) * 50.45);
    left: calc(var(--cqi) * 60.3);
    gap: calc(var(--cqi) * 2.6);
    width: calc(var(--cqi) * 23.5);
    font-size: calc(var(--cqi) * 4.3);
  }

  .about-card__prompt {
    gap: calc(var(--cqi) * 1.2);
    height: calc(var(--cqi) * 5.15);
    font-size: calc(var(--cqi) * 2.4);
  }

  .about-card__arrow {
    width: calc(var(--cqi) * 3.6);
  }

  .about-card__prompt:hover .about-card__arrow {
    transform: translateX(var(--cqi));
  }

  .about-card__back-title {
    max-width: calc(var(--cqi) * 66);
    font-size: calc(var(--cqi) * 6.6);
  }

  .about-card__copy {
    margin-top: calc(var(--cqi) * 3.9);
    font-size: calc(var(--cqi) * 3.975);
  }
}

/* CASE STUDIES */

.case-studies__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.5rem, 2.5vw, 2.5rem);
  margin-top: 3rem;
}

.case-study {
  min-width: 0;
  cursor: pointer;
  transition: transform 300ms ease;
}

.case-study:hover {
  transform: scale(1.07);
}

.case-study:active {
  transform: scale(0.96);
  transition-duration: 80ms;
}

.case-study__link {
  display: block;
  color: inherit;
  border-radius: 1.25rem;
}

/* Keyboard focus gets the same lift as hover, plus a visible ring. */
.case-study:has(.case-study__link:focus-visible) {
  transform: scale(1.07);
}

.case-study__link:focus-visible {
  outline: 3px solid var(--clementine);
  outline-offset: 6px;
}

.case-study__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 1.25rem;
}

.case-study__title {
  margin-top: 1rem;
  color: var(--charcoal);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.1;
  text-transform: uppercase;
}

/* OUR CAPABILITIES */

.capabilities__stage {
  position: relative;
}

.capabilities__metaballs {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}

.capabilities__stage.is-proxy-running .capabilities__metaballs {
  opacity: 1;
}

.capabilities__list {
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  max-width: 75rem;
  /* Pulled up under the heading to keep the section compact. */
  margin: 2rem auto 0;
  list-style: none;
}

.capabilities__item {
  --layout-x: 0px;
  --layout-y: 0px;

  position: relative;
  display: flex;
  justify-content: center;
  z-index: 1;
  opacity: 1;
  transform: translate(var(--layout-x), var(--layout-y)) scale(1);
  transition:
    opacity 280ms ease-out,
    transform 500ms cubic-bezier(0.16, 1.2, 0.3, 1);
}

/* While the proxy animation runs, bubbles stay hidden until each one forms
   (formed bubbles fall back to the visible state above). */
.capabilities__stage.is-proxy-preparing .capabilities__item,
.capabilities__stage.is-proxy-running .capabilities__item:not(.is-formed) {
  opacity: 0;
  transform: translate(var(--layout-x), var(--layout-y)) scale(0.92);
}

.capabilities__stage.is-proxy-preparing .capabilities__item {
  transition: none;
}

.capability {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 1rem;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  background: transparent;
  color: var(--charcoal);
  border: 0;
  border-radius: 50%;
}

.capabilities__item--small .capability {
  flex: 0 0 10rem;
}

.capabilities__item--medium .capability {
  flex: 0 0 12rem;
}

.capabilities__item--large .capability {
  flex: 0 0 15rem;
}

/* Between 601px and 1199px the bubbles wrap as flex items. Each item gets
   its bubble's width: older Safari (seen on 14) sizes the item from its
   label instead of the bubble's flex-basis, so bubbles overlapped. */
@media (min-width: 601px) and (max-width: 1199px) {
  .capabilities__item--small {
    width: 10rem;
  }

  .capabilities__item--medium {
    width: 12rem;
  }

  .capabilities__item--large {
    width: 15rem;
  }
}

.capabilities__item--yellow .capability {
  background-color: var(--goldenhour);
}

.capabilities__item--orange .capability {
  background-color: var(--clementine);
}

.capabilities__item--pink .capability {
  background-color: var(--blush);
}

/* The bubbles are static until v2 gives them actions. To re-enable: add
   data-interactive to .capabilities__list and turn each .capability span
   back into <button type="button"> (see the comment in index.html). */
.capabilities__list[data-interactive] .capability {
  cursor: pointer;
  transition:
    transform 300ms ease,
    box-shadow 300ms ease;
}

.capabilities__list[data-interactive] .capability:hover {
  transform: scale(1.07);
  box-shadow: 0 0.25rem 0 var(--charcoal);
}

.capabilities__list[data-interactive] .capability:active {
  transform: scale(0.96);
  box-shadow: 0 0.1rem 0 var(--charcoal);
}

.capabilities__list[data-interactive] .capability:focus-visible {
  outline: 3px solid var(--charcoal);
  outline-offset: 4px;
}

/* STREET CRED */

.testimonials {
  position: relative;
  margin-top: 3rem;
}

.testimonials__track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 0 3.5rem 1rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--charcoal) transparent;
}

.testimonials__btn {
  position: absolute;
  z-index: 1;
  top: 50%;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  color: var(--charcoal);
  font-size: 1.5rem;
  line-height: 1;
  background-color: var(--lightgoldenhour);
  border: 1px solid var(--charcoal);
  border-radius: 50%;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    transform 300ms ease,
    background-color 300ms ease;
}

.testimonials__btn--previous {
  left: 0.5rem;
}

.testimonials__btn--next {
  right: 0.5rem;
}

.testimonials__btn:hover,
.testimonials__btn:focus-visible {
  background-color: var(--goldenhour);
  transform: translateY(-50%) scale(1.07);
}

.testimonials__btn:focus-visible {
  outline: 3px solid var(--charcoal);
  outline-offset: 3px;
}

.testimonials__btn:active {
  transform: translateY(-50%) scale(0.96);
  background-color: var(--button-pressed);
}

.testimonials__track::-webkit-scrollbar {
  height: 0.5rem;
}

.testimonials__track::-webkit-scrollbar-track {
  background: transparent;
}

.testimonials__track::-webkit-scrollbar-thumb {
  background-color: var(--charcoal);
  border: 0.125rem solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.testimonial {
  display: grid;
  flex: 0 0 100%;
  min-height: 20rem;
  padding: clamp(2rem, 6vw, 5rem);
  place-items: center;
  color: var(--charcoal);
  text-align: center;
  scroll-snap-align: center;
  background:
    radial-gradient(
      circle at center,
      color-mix(in srgb, var(--lightblush) 45%, transparent) 0%,
      transparent 70%
    ),
    var(--linen);
  border: 1px solid var(--charcoal);
  border-radius: 1.25rem;
}

.testimonial__quote {
  max-width: 52rem;
}

.testimonial__quote p {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 500;
  line-height: 1.25;
}

.testimonial__attribution {
  display: grid;
  gap: 0.25rem;
  margin-top: 1.5rem;
}

.testimonial__name {
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
}

.testimonial__role {
  font-size: 1.5rem;
}

.testimonial--long {
  position: relative;
  cursor: pointer;
}

.testimonial__body {
  display: grid;
  justify-items: center;
}

.testimonial--long .testimonial__quote p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

/* Multi-paragraph quotes preview only their first paragraph; the modal shows all. */
.testimonial--long .testimonial__quote p + p {
  display: none;
}

.testimonial__more {
  margin-top: 1rem;
  color: var(--charcoal);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  background: none;
  border: 0;
  cursor: pointer;
}

.testimonial__more::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  content: "";
  border-radius: 1.25rem;
}

.testimonial__more span {
  display: inline-block;
  transition: transform 220ms ease-out;
}

.testimonial--long:hover .testimonial__more span,
.testimonial__more:focus-visible span {
  transform: translateX(4px);
}

.testimonial__more:focus-visible {
  outline: none;
}

.testimonial__more:focus-visible::after {
  outline: 3px solid var(--charcoal);
  outline-offset: -6px;
}

/* CONTACT */

.contact__title-line {
  display: inline-block;
  white-space: nowrap;
}

.contact__title-line > span > span {
  display: inline-block;
  opacity: 0;
  transform: translateX(-1rem);
}

/* Each letter sets --i; "Together" starts after the splash lands. */
.section__header.is-visible .contact__title-line > span > span {
  animation: contact-letter-in 350ms ease-out forwards;
  animation-delay: calc(var(--i) * 70ms);
}

.section__header.is-visible .contact__title-line--end > span > span {
  animation-delay: calc(2.6s + var(--i) * 70ms);
}

.contact__title-space {
  width: 0.25em;
}

.splash-word {
  position: relative;
  display: inline-block;
  color: transparent;
  background: linear-gradient(
    90deg,
    var(--clementine),
    var(--goldenhour) 45%,
    var(--blush)
  );
  background-clip: text;
  -webkit-background-clip: text;
}

.splash-word__droplets {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

.splash-word__droplets span {
  position: absolute;
  width: 0.7rem;
  aspect-ratio: 1;
  opacity: 0;
  background-color: var(--clementine);
  border-radius: 50%;
}

.section__header.is-visible .splash-word {
  animation: splash-word-arrive 850ms cubic-bezier(0.22, 1.45, 0.36, 1) 1.3s
    both;
}

.section__header.is-visible .splash-word__droplets span {
  animation: splash-droplet 650ms ease-out both;
}

.section__header.is-visible .splash-word__droplets span:nth-child(1) {
  top: 20%;
  left: 15%;
  background-color: var(--clementine);
  --droplet-x: -1.4rem;
  --droplet-y: -1.8rem;
  animation-delay: 1.48s;
}

.section__header.is-visible .splash-word__droplets span:nth-child(2) {
  top: 0;
  left: 48%;
  width: 1rem;
  background-color: var(--goldenhour);
  --droplet-x: 0.2rem;
  --droplet-y: -2.1rem;
  animation-delay: 1.52s;
}

.section__header.is-visible .splash-word__droplets span:nth-child(3) {
  top: 30%;
  right: 8%;
  background-color: var(--blush);
  --droplet-x: 1.5rem;
  --droplet-y: -1.25rem;
  animation-delay: 1.46s;
}

.section__header.is-visible .splash-word__droplets span:nth-child(4) {
  right: 30%;
  bottom: 0;
  width: 0.55rem;
  background-color: var(--clementine);
  --droplet-x: 0.8rem;
  --droplet-y: 1.15rem;
  animation-delay: 1.55s;
}

.section__header.is-visible .splash-word__droplets span:nth-child(5) {
  bottom: 5%;
  left: 30%;
  width: 0.5rem;
  background-color: var(--goldenhour);
  --droplet-x: -0.9rem;
  --droplet-y: 0.9rem;
  animation-delay: 1.5s;
}

/* Safari before 15 has no aspect-ratio: give the droplets their height and
   square the capability bubbles with a padding-top spacer that shares the
   label's grid cell. Modern browsers skip this block. */
@supports not (aspect-ratio: 1) {
  .capability::before {
    content: "";
    grid-area: 1 / 1;
    padding-top: 100%;
  }

  .capability > span {
    grid-area: 1 / 1;
  }

  /* Case-study photos: a 4:3 spacer holds the image's grid cell and the
     image is pinned over it, cropped by object-fit as in modern browsers. */
  .case-study__link {
    position: relative;
    display: grid;
  }

  .case-study__link::before {
    content: "";
    grid-area: 1 / 1;
    padding-top: 75%;
  }

  .case-study__img {
    position: absolute;
    grid-area: 1 / 1;
    top: 0;
    left: 0;
    height: 100%;
  }

  /* Safari 14 snaps the testimonials as if the track had no side padding,
     leaving cards off-center. Margins inset the track instead, so the snap
     positions no longer depend on padding. */
  .testimonials__track {
    margin: 0 3.5rem;
    padding: 0 0 1rem;
  }

  .splash-word__droplets span {
    height: 0.7rem;
  }

  .section__header.is-visible .splash-word__droplets span:nth-child(2) {
    height: 1rem;
  }

  .section__header.is-visible .splash-word__droplets span:nth-child(4) {
    height: 0.55rem;
  }

  .section__header.is-visible .splash-word__droplets span:nth-child(5) {
    height: 0.5rem;
  }
}

/* Safari 14.0 ignores gap on flex containers. It also lacks inset, which
   arrived with flex gap in 14.1, so that test targets it; margins stand in
   for the gaps. Modern browsers skip this block. */
@supports not (inset: 0) {
  .moodboard-swatch + .moodboard-swatch {
    margin-left: calc(var(--u) * 1.1);
  }

  .about-card__footer > * + * {
    margin-top: calc(var(--cqi) * 2.6);
  }

  .about-card__arrow {
    margin-left: calc(var(--cqi) * 1.2);
  }

  .testimonial + .testimonial {
    margin-left: 1.5rem;
  }

  @media (max-width: 640px) {
    .moodboard-swatch + .moodboard-swatch {
      margin-left: calc(var(--u) * 1.4);
    }
  }

  @media (min-width: 641px) and (max-width: 1080px) {
    .moodboard-swatch + .moodboard-swatch {
      margin-left: calc(var(--u) * 0.9);
    }
  }

  /* Between 601px and 1199px the bubbles wrap as flex items (grid above and
     below); half-gap margins on every side, offset on the list so rows wrap
     at the same widths as gap. */
  @media (min-width: 601px) and (max-width: 1199px) {
    .capabilities__list {
      margin-top: 0.75rem;
      margin-right: -1.25rem;
      margin-bottom: -1.25rem;
      margin-left: -1.25rem;
    }

    .capabilities__item {
      margin: 1.25rem;
    }
  }
}

.contact__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.contact__card {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 16rem;
  padding: 2rem;
  isolation: isolate;
}

.contact__card h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: center;
}

/* Soft glow behind each card in its color (set by the modifiers below). */
.contact__card::before {
  position: absolute;
  z-index: -1;
  width: 20rem;
  height: 20rem;
  content: "";
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--card-color) 70%, transparent) 0%,
    color-mix(in srgb, var(--card-light) 35%, transparent) 35%,
    transparent 72%
  );
}

.contact__card--clementine {
  --card-color: var(--clementine);
  --card-light: var(--lightclementine);
}

.contact__card--blush {
  --card-color: var(--blush);
  --card-light: var(--lightblush);
}

.contact__card--goldenhour {
  --card-color: var(--goldenhour);
  --card-light: var(--lightgoldenhour);
}

.btn--clementine {
  background-color: var(--lightclementine);
}

.btn--clementine:hover {
  background-color: var(--clementine);
}

.btn--blush {
  background-color: var(--lightblush);
}

.btn--blush:hover {
  background-color: var(--blush);
}

.btn--goldenhour {
  background-color: var(--lightgoldenhour);
}

.btn--goldenhour:hover {
  background-color: var(--goldenhour);
}

/* TESTIMONIAL MODAL */

.testimonial-modal {
  width: min(100% - 2rem, 48rem);
}

.testimonial-modal__role {
  margin-top: 0.5rem;
  font-size: 1rem;
}

.testimonial-modal__quote p {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  line-height: 1.55;
}

.testimonial-modal__quote p + p {
  margin-top: 1em;
}

/* ANIMATIONS */

@keyframes hero-word-cycle {
  0% {
    opacity: 0;
    filter: blur(0.3rem);
    transform: translate(-50%, -50%) scale(0.65);
  }

  12% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1.06);
  }

  20%,
  84% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    filter: blur(0.2rem);
    transform: translate(-50%, -50%) scale(0.8);
  }
}

@keyframes hero-moodboard-fade {
  from {
    visibility: hidden;
    opacity: 0;
  }

  to {
    visibility: visible;
    opacity: 1;
  }
}

@keyframes hero-moodboard-settle {
  from {
    filter: blur(0.3rem);
    transform: scale(0.94);
  }

  to {
    filter: blur(0);
    transform: scale(1);
  }
}

@keyframes moodboard-piece-in {
  from {
    opacity: 0;
    translate: 0 0.75rem;
    scale: 0.92;
  }

  to {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
}

@keyframes contact-letter-in {
  from {
    opacity: 0;
    transform: translateX(-1rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes splash-word-arrive {
  0% {
    opacity: 0;
    filter: blur(0.35rem);
    transform: translateY(1.5rem) scale(0.45, 0.7);
  }

  55% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-0.2rem) scale(1.12, 0.9);
  }

  75% {
    transform: translateY(0.1rem) scale(0.96, 1.05);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes splash-droplet {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0);
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(var(--droplet-x), var(--droplet-y)) scale(1);
  }
}

/* MEDIA QUERIES */

/* Large Screens */
@media (min-width: 1200px) {
  .capabilities__list {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: 15rem 16rem;
    align-items: center;
    gap: 1rem;
    max-width: 76rem;
  }

  .capabilities__item {
    display: grid;
    place-items: center;
  }

  .capabilities__item--small .capability {
    width: 8.5rem;
  }

  .capabilities__item--medium .capability {
    width: 10rem;
  }

  .capabilities__item--large .capability {
    width: 13rem;
  }

  /* Six per row. Vertical offsets give the organic stagger; horizontal
     offsets keep the edge-to-edge gaps even, since grid columns are equal
     width but the bubbles aren't. Recalculate --layout-x if sizes change. */
  .capabilities__item:nth-child(2) {
    --layout-x: -0.15rem;
    --layout-y: 2.5rem;
  }

  .capabilities__item:nth-child(3) {
    --layout-x: -1.8rem;
    --layout-y: 0.5rem;
  }

  .capabilities__item:nth-child(4) {
    --layout-x: -1.2rem;
    --layout-y: 1.25rem;
  }

  .capabilities__item:nth-child(5) {
    --layout-x: -0.6rem;
    --layout-y: 2.25rem;
  }

  .capabilities__item:nth-child(7) {
    --layout-y: -1.5rem;
  }

  .capabilities__item:nth-child(8) {
    --layout-x: -1.8rem;
    --layout-y: 0.25rem;
  }

  .capabilities__item:nth-child(9) {
    --layout-x: -1.35rem;
    --layout-y: 0.75rem;
  }

  .capabilities__item:nth-child(10) {
    --layout-x: -0.9rem;
    --layout-y: -1rem;
  }

  .capabilities__item:nth-child(11) {
    --layout-x: -0.45rem;
    --layout-y: 0.5rem;
  }

  .capabilities__item:nth-child(12) {
    --layout-y: -1.25rem;
  }
}

/* Navbar collapses, 1080px and below */
@media (max-width: 1080px) {
  /* Four case studies fit as a 2 × 2 grid on tablets. */
  .case-studies__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Large tablets, 768px and below */
@media (max-width: 768px) {
  #about {
    min-height: auto;
    background-position: 35% center;
  }

  .about__row {
    min-height: 40rem;
    align-items: end;
    justify-items: center;
    padding: 12rem 0 2.75rem;
  }

  .case-studies__grid {
    grid-template-columns: 1fr;
    max-width: 32rem;
    /* The top margin offsets the heading shift, keeping the 24px gap. */
    margin: var(--section-shift) auto 0;
  }

  .contact__grid {
    grid-template-columns: 1fr;
  }
}

/* Phones, 600px and below */
@media (max-width: 600px) {
  .hero-word {
    font-size: 2.875rem;
  }

  .capabilities__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
  }

  .capabilities__item {
    align-items: center;
  }

  /* Drop the middle column for an organic stagger */
  .capabilities__item:nth-child(3n + 2) {
    --layout-y: 1.25rem;
  }

  .capabilities__item .capability {
    flex: none;
  }

  .capability {
    padding: 0.25rem;
    font-size: clamp(0.65rem, 3.2vw, 0.9rem);
  }

  .capabilities__item--small .capability {
    width: 78%;
  }

  .capabilities__item--medium .capability {
    width: 89%;
  }

  .capabilities__item--large .capability {
    width: 100%;
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-word {
    display: none;
    animation: none;
  }

  .hero-moodboard,
  .hero-moodboard__stage,
  .moodboard-piece {
    animation: none;
  }

  .contact__title-line > span > span {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .section__header.is-visible .splash-word,
  .section__header.is-visible .splash-word__droplets span {
    animation: none;
  }

  .splash-word__droplets {
    display: none;
  }

  .capabilities__metaballs {
    display: none;
  }

  .capabilities__item,
  .capabilities__stage.is-proxy-preparing .capabilities__item,
  .capabilities__stage.is-proxy-running .capabilities__item:not(.is-formed) {
    opacity: 1;
    transform: translate(var(--layout-x), var(--layout-y)) scale(1);
    transition: none;
  }

  .capabilities__list[data-interactive] .capability,
  .about-card__arrow {
    transition: none;
  }

  .capabilities__list[data-interactive] .capability:hover,
  .capabilities__list[data-interactive] .capability:active {
    transform: none;
  }

  .testimonials__btn {
    transition: background-color 300ms ease;
  }

  .testimonials__btn:hover,
  .testimonials__btn:focus-visible {
    transform: translateY(-50%);
  }

  .testimonial__more span {
    transition: none;
  }
}
