/* Jiaying's original Procreate lettering, used as a restrained semantic accent. */
:root {
  --handwriting-green: #a6df00;
  --handwriting-edge: rgba(91, 119, 0, 0.52);
}

.handword {
  --handword-image: none;
  --handword-width: 2.7em;
  --handword-height: 0.86em;
  --handword-shift: 0.11em;
  --handword-rotate: 0deg;
  position: relative;
  display: inline-block;
  width: var(--handword-width);
  height: var(--handword-height);
  margin-inline: 0.035em;
  font-size: 1.36em;
  vertical-align: calc(var(--handword-shift) * -1);
  background-color: var(--handwriting-green);
  -webkit-mask-image: var(--handword-image);
  mask-image: var(--handword-image);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  filter: drop-shadow(0 0 0.32px var(--handwriting-edge));
  transform: rotate(var(--handword-rotate));
  transform-origin: 50% 62%;
}

.handword__text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.handword--sporty {
  --handword-image: url("assets/handwriting/sporty.png");
  --handword-width: 2.86em;
  --handword-height: 0.83em;
  --handword-rotate: -1.4deg;
}

.handword--tender {
  --handword-image: url("assets/handwriting/tender.png");
  --handword-width: 3.42em;
  --handword-height: 0.78em;
  --handword-rotate: -0.7deg;
}

.handword--curious {
  --handword-image: url("assets/handwriting/curious.png");
  --handword-width: 3.52em;
  --handword-height: 0.76em;
  --handword-rotate: 0.5deg;
}

.handword--momentum {
  --handword-image: url("assets/handwriting/momentum.png");
  --handword-width: 4.02em;
  --handword-height: 0.82em;
  --handword-rotate: -0.8deg;
}

.handword--ai-builder {
  --handword-image: url("assets/handwriting/ai-builder.png");
  --handword-width: 3.7em;
  --handword-height: 1.01em;
  --handword-shift: 0.14em;
  --handword-rotate: -0.8deg;
}

.handword--scale {
  --handword-image: url("assets/handwriting/scale.png");
  --handword-width: 2.4em;
  --handword-height: 0.84em;
  --handword-rotate: 0.6deg;
}

.handword--frame {
  --handword-image: url("assets/handwriting/frame.png");
  --handword-width: 2.6em;
  --handword-height: 0.84em;
  --handword-rotate: -0.7deg;
}

.handword--context {
  --handword-image: url("assets/handwriting/context.png");
  --handword-width: 3.38em;
  --handword-height: 0.88em;
  --handword-rotate: 0.5deg;
}

.handword--move {
  --handword-image: url("assets/handwriting/move.png");
  --handword-width: 2.88em;
  --handword-height: 0.97em;
  --handword-rotate: -0.4deg;
}

.back-to-top {
  position: fixed;
  right: clamp(16px, 2vw, 32px);
  bottom: clamp(16px, 2vw, 28px);
  z-index: 950;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(17, 17, 15, 0.24);
  border-radius: 50%;
  background: rgba(247, 247, 244, 0.88);
  color: #171714;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    color 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease,
    opacity 220ms ease,
    transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  border-color: #a6df00;
  background: #a6df00;
  color: #11110f;
}

.back-to-top:focus-visible {
  outline: 2px solid #171714;
  outline-offset: 3px;
}

.back-to-top__arrow {
  position: relative;
  display: block;
  width: 12px;
  height: 17px;
}

.back-to-top__arrow::before {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.back-to-top__arrow::after {
  position: absolute;
  top: 3px;
  bottom: 1px;
  left: 50%;
  width: 1.5px;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}

.handword--shape {
  --handword-image: url("assets/handwriting/shape.png");
  --handword-width: 2.96em;
  --handword-height: 0.9em;
  --handword-shift: 0.15em;
  --handword-rotate: -0.8deg;
}

.handword--unpack-thinking {
  --handword-image: url("assets/handwriting/unpack-thinking.png");
  --handword-width: 6.8em;
  --handword-height: 1.01em;
  --handword-shift: 0.12em;
  --handword-rotate: -0.5deg;
}

@media (min-width: 761px) {
  .d-hero h1.d-hero__statement {
    max-width: min(730px, 45vw);
    font-size: clamp(37px, 3vw, 58px);
    font-weight: 390;
    letter-spacing: -0.048em;
    line-height: 1;
    text-transform: none;
    text-wrap: pretty;
  }

  .d-hero h1.d-hero__statement .handword {
    display: inline-block;
    font-size: 1.12em;
    background-color: var(--handwriting-green);
  }

  .d-hero h1.d-hero__statement .d-hero__trait {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
  }

  .d-capabilities__topline {
    margin-top: -30px;
  }

  .d-cap-card:nth-child(1) .d-cap-sticker-image {
    --cap-sticker-y: 58px;
  }

  .d-hero__kicker {
    margin-bottom: clamp(24px, 3vh, 36px);
  }

  .d-capabilities__topline h2,
  .d-contact h2 {
    text-wrap: balance;
  }

  .d-products__header h2 {
    max-width: none;
    font-size: clamp(44px, 4.15vw, 72px);
    white-space: nowrap;
    text-wrap: nowrap;
  }

  .ai-practice__title {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 7;
    max-width: 760px;
    margin: 0;
    color: #171913;
    font-family: var(--text);
    font-size: clamp(25px, 2.2vw, 40px);
    font-weight: 430;
    letter-spacing: -0.055em;
    line-height: 0.95;
    text-transform: uppercase;
    pointer-events: none;
  }

  .ai-practice__title .handword {
    background-color: var(--handwriting-green);
  }

  .d-resume__panel-heading {
    display: block;
    min-height: clamp(92px, 11vh, 126px);
    padding: 0 0 clamp(16px, 1.8vh, 22px);
  }

  .d-resume__panel-heading > span,
  .d-resume__panel-heading > strong {
    display: block;
  }

  .d-resume__panel-heading .handword {
    display: inline-block;
  }

  .d-vending-guide h3 .handword--unpack-thinking {
    display: block;
    margin: 0.08em 0 0 0.04em;
    font-size: 0.62em;
  }

  .d-resume__panel-heading > span {
    margin-bottom: 9px;
    color: #729500;
    font-size: 9px;
    font-weight: 620;
    letter-spacing: 0.13em;
    text-transform: uppercase;
  }

  .d-resume__panel-heading > strong {
    max-width: 100%;
    color: #171714;
    font-size: clamp(26px, 2.25vw, 39px);
    font-weight: 390;
    letter-spacing: -0.052em;
    line-height: 0.94;
    text-transform: uppercase;
    text-wrap: balance;
  }

  .d-resume__panel-heading::before,
  .d-resume__panel-heading::after {
    display: none;
    content: none;
  }
}

@media (min-width: 1800px) {
  .d-cap-card:nth-child(4) .d-cap-sticker-image {
    --cap-sticker-x: 28px;
    --cap-sticker-y: 26px;
    --cap-sticker-render-scale: 0.94;
    --cap-sticker-hover-render-scale: 0.975;
  }
}

@media (min-width: 761px) and (max-width: 1120px) {
  .d-hero h1.d-hero__statement {
    max-width: 44vw;
    font-size: clamp(32px, 4vw, 44px);
  }

  .d-resume__panel-heading > strong {
    font-size: clamp(23px, 2.55vw, 30px);
  }
}

@media (min-width: 761px) and (max-height: 820px) {
  .d-resume__panel-heading {
    min-height: 82px;
    padding-bottom: 12px;
  }

  .d-resume__panel-heading > span {
    margin-bottom: 6px;
  }

  .d-resume__panel-heading > strong {
    font-size: clamp(22px, 1.8vw, 29px);
  }
}

@media (max-width: 900px) {
  .ai-practice__title {
    position: relative;
    top: auto;
    left: auto;
    margin-bottom: 30px;
    font-size: clamp(30px, 7vw, 44px);
  }
}

@media (max-width: 760px) {
  .back-to-top {
    right: 14px;
    bottom: 14px;
    width: 40px;
    height: 40px;
  }

  .d-hero {
    min-height: 0;
    padding-top: 64px;
  }

  .d-hero > picture {
    position: relative;
    top: auto;
    right: auto;
    width: calc(100% - 32px);
    margin: 18px 16px 0;
    aspect-ratio: 4 / 5;
  }

  .d-hero__content {
    min-height: 0;
    justify-content: flex-start;
    padding: 24px 16px 86px;
  }

  .d-hero__kicker {
    position: static;
    max-width: none;
    margin-bottom: 18px;
  }

  .d-hero h1.d-hero__statement {
    max-width: 100%;
    font-size: clamp(30px, 8.7vw, 36px);
    font-weight: 390;
    letter-spacing: -0.052em;
    line-height: 1.03;
    text-transform: none;
    text-wrap: pretty;
  }

  .d-hero h1.d-hero__statement .d-hero__trait {
    display: inline;
    white-space: nowrap;
  }

  .d-hero h1.d-hero__statement .handword {
    display: inline-block;
    font-size: 1.18em;
  }
}

@media (forced-colors: active) {
  .handword {
    width: auto;
    height: auto;
    background: none;
    -webkit-mask-image: none;
    mask-image: none;
    transform: none;
  }

  .handword__text {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
}
