/* A negative exposed in the wordmark. The cream and coral are photographic
   tones in the type. The paper beneath it stays a saturated ultramarine. */
.opening {
  --mast-blue: #2d38cc;
  --mast-coral: #ff765b;
  --mast-paper: #fff4e8;
  background: var(--mast-blue);
  color: var(--mast-paper);
}

.opening .mast {
  border-color: rgb(255 244 232 / 0.48);
}
.opening .mast a {
  color: var(--mast-paper);
}
.opening .mast a:focus-visible {
  outline-color: var(--mast-paper);
}
.opening .mast .diagonal {
  color: #ffa58e;
}
.opening .firm-offer {
  color: #ece7ff;
}
.opening .wordmark {
  position: relative;
}

.opening .wordmark > span {
  display: block;
  color: var(--mast-paper);
  animation: none;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .opening .wordmark > span {
    /* A readable paper fill remains if the photograph can't be fetched. */
    background: var(--mast-paper) url('assets/mast-negative.webp') 49% 46% / 114% auto no-repeat;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .opening .wordmark > span {
    animation: mast-film-exposure 0.85s cubic-bezier(0.18, 0.74, 0.18, 1) backwards;
  }
  .opening .wordmark::after {
    content: '';
    position: absolute;
    top: 12%;
    bottom: 12%;
    left: 0;
    right: 0;
    background: var(--mast-coral);
    pointer-events: none;
    transform: scaleX(0);
    transform-origin: 100% 50%;
    animation: mast-shutter 1.05s linear backwards;
  }

  @keyframes mast-film-exposure {
    from {
      clip-path: inset(0 85% 0 0);
    }
    to {
      clip-path: inset(-0.08em);
    }
  }
  @keyframes mast-shutter {
    0% {
      clip-path: inset(0 100% 0 0);
      transform: scaleX(1);
    }
    35% {
      clip-path: inset(0 0 0 0);
      transform: scaleX(1);
      animation-timing-function: cubic-bezier(0.18, 0.78, 0.22, 1);
    }
    100% {
      clip-path: inset(0 0 0 0);
      transform: scaleX(0);
    }
  }

  .opening .mast a .diagonal {
    transition: transform 0.22s cubic-bezier(0.2, 0.72, 0.24, 1);
  }
  .opening .mast a:is(:hover, :focus-visible) .diagonal {
    transform: translate(2px, -2px);
  }
}

@media (forced-colors: active) {
  .opening .wordmark > span {
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
    background: none;
    animation: none;
  }
  .opening .wordmark::after {
    display: none;
  }
}
