.brand {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  position: relative;
  color: #ecd08d;
  font-family: Zapfino, "Snell Roundhand", "Apple Chancery", cursive;
  font-size: clamp(1.18rem, 2vw, 1.58rem);
  font-style: normal;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255,255,255,.12), 0 6px 18px rgba(0,0,0,.72);
}

.brand::after {
  content: "";
  position: absolute;
  left: 3.6rem;
  right: 0;
  bottom: -.45rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(237,205,132,.85), rgba(237,205,132,0));
}

.brand > span:first-child {
  width: 2.7rem;
  height: 3.35rem;
  flex: 0 0 auto;
  display: block;
  margin: 0;
  border: 0;
  overflow: hidden;
  color: transparent;
  font-size: 0;
  background: center / contain no-repeat url("assets/brand-mask.png");
  filter: drop-shadow(0 7px 12px rgba(0, 0, 0, .5));
}

.brand .brand-name {
  display: inline-block;
  width: auto;
  height: auto;
  margin: 0;
  border: 0;
  color: inherit;
  font: inherit;
  line-height: 2.2;
  padding: .75em 0;
  margin: -.75em 0;
  overflow: visible;
  white-space: nowrap;
  clip-path: inset(-120% 100% -140% 0);
  animation: write-name 2.5s cubic-bezier(.3,.02,.18,1) .25s forwards;
}

.brand .brand-quill {
  position: absolute;
  z-index: 2;
  left: 3.55rem;
  top: -.75rem;
  width: 2.15rem;
  height: 3.65rem;
  margin: 0;
  border: 0;
  background: center / contain no-repeat url("assets/writer-quill-realistic.png");
  filter: drop-shadow(0 5px 7px rgba(0,0,0,.6));
  opacity: 0;
  transform: rotate(25deg);
  transform-origin: 35% 94%;
  pointer-events: none;
  animation: quill-write 2.5s cubic-bezier(.3,.02,.18,1) .25s forwards;
}

.brand-static .brand-name {
  clip-path: none;
  animation: none;
}

@keyframes write-name {
  to { clip-path: inset(-120% 0 -140% 0); }
}

@keyframes quill-write {
  0% { left: 3.55rem; top: -.9rem; opacity: 0; }
  5% { opacity: 1; }
  30% { top: -.35rem; }
  58% { top: -.8rem; }
  88% { opacity: 1; }
  100% { left: calc(100% - .7rem); top: -.4rem; opacity: 0; }
}

@media (max-width: 540px) {
  .brand {
    gap: .7rem;
    font-size: 1.03rem;
    letter-spacing: 0;
  }

  .brand::after {
    left: 2.95rem;
  }

  .brand > span:first-child {
    width: 2.25rem;
    height: 2.8rem;
  }
}

@media (max-width: 380px) {
  .brand {
    gap: .5rem;
    font-size: .88rem;
  }

  .brand > span:first-child {
    width: 1.85rem;
    height: 2.35rem;
  }

  .brand::after {
    left: 2.35rem;
  }
}
