/* "Sökes": the recruitment poster on the front page and the guild page. The paper is painted
   (assets/src/recruit/), every word on it is HTML. The poster is a plain link to the application
   form; wanted.js only adds the arrow that pins it before the form opens. */
.wanted-section {
  overflow-x: clip;
  background:
    radial-gradient(60rem 30rem at 70% 40%, rgb(255 166 77 / 0.1), transparent 70%),
    var(--ground);
  color: var(--ink);
}

.wanted-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 25rem);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 6.5rem);
}

.wanted-copy h2 {
  margin: 0;
}

.wanted-copy p {
  max-width: 44ch;
  margin-block: 1.1rem 0;
}

.wanted-steps {
  display: grid;
  gap: 0.55rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.wanted-steps li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  align-items: baseline;
  counter-increment: step;
}

.wanted-steps li::before {
  content: counter(step);
  font-family: var(--heading);
  font-weight: 900;
  font-size: 1.35rem;
  color: #ffa64d;
}

/* The poster. Its box keeps the paper's 2:3 ratio; text is placed in percent of it. */
.wanted {
  --tilt: -7deg;
  position: relative;
  display: block;
  justify-self: center;
  z-index: 1;
  inline-size: 86%;
  aspect-ratio: 2 / 3;
  color: #2b1a10;
  text-decoration: none;
  transform-origin: 50% 2%;
  transform: rotate(var(--tilt));
  filter: drop-shadow(0 1.2rem 1.6rem rgb(0 0 0 / 0.55));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.wanted-paper {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 19% 15% 15%;
  text-align: center;
  container-type: inline-size;
}

.wanted-paper-image {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: fill;
}

.wanted-paper:where(:not(.is-painted, :has(noscript img))) {
  background-color: #d2ad7b;
}

.wanted-kicker,
.wanted-title,
.wanted-sub,
.wanted-terms,
.wanted-cta {
  font-family: var(--heading);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.95;
}

.wanted-kicker {
  font-size: 7cqi;
  letter-spacing: 0.18em;
  color: #6e2a18;
}

.wanted-title {
  margin-block-start: 3cqi;
  font-size: 27cqi;
  letter-spacing: 0.04em;
  color: #3a1d10;
  text-shadow: 0 0.06em 0 rgb(255 236 200 / 0.35);
}

.wanted-sub {
  font-size: 9.5cqi;
  letter-spacing: 0.12em;
}

.wanted-rule {
  inline-size: 70%;
  block-size: 0;
  margin-block: 5cqi 4cqi;
  border-block-start: 0.5cqi solid rgb(58 29 16 / 0.55);
}

.wanted-terms {
  font-size: 7.5cqi;
  letter-spacing: 0.08em;
  color: #6e2a18;
}

.wanted-list {
  margin-block-start: 2.5cqi;
  font-size: 6cqi;
  font-weight: 600;
}

.wanted-reward {
  display: grid;
  margin-block-start: auto;
  font-size: 6.4cqi;
  font-weight: 700;
}

.wanted-reward span {
  font-family: var(--heading);
  font-weight: 900;
  font-size: 5cqi;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6e2a18;
}

.wanted-cta {
  margin-block-start: 4cqi;
  padding: 1.6cqi 5cqi 1.2cqi;
  border: 0.6cqi solid #6e2a18;
  font-size: 7cqi;
  letter-spacing: 0.12em;
  color: #6e2a18;
}

/* The guild's mark, stamped in red ink. */
.wanted-stamp {
  position: absolute;
  inset: auto 9% 17% auto;
  inline-size: 21%;
  opacity: 0.32;
  transform: rotate(14deg);
  mix-blend-mode: multiply;
  filter: sepia(1) saturate(4) hue-rotate(-28deg) brightness(0.6);
  pointer-events: none;
}

/* The arrow: its point lands at the impact spot (--hit-x, --hit-y) in the top-right corner. */
.wanted {
  --hit-x: 71%;
  --hit-y: 21%;
}

.wanted-arrow,
.wanted-stuck {
  position: absolute;
  pointer-events: none;
  visibility: hidden;
}

.wanted-arrow {
  inline-size: 120%;
  block-size: auto;
  inset-block-start: calc(var(--hit-y) - 6.7%);
  inset-inline-start: calc(var(--hit-x) - 120%);
}

.wanted-stuck {
  inline-size: 34%;
  block-size: auto;
  inset-inline-start: calc(var(--hit-x) - 4%);
  inset-block-start: calc(var(--hit-y) - 21%);
}

.wanted:hover,
.wanted:focus-visible {
  --tilt: -4deg;
  filter: drop-shadow(0 1.6rem 2rem rgb(0 0 0 / 0.6)) brightness(1.04);
}

.wanted:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 0.6rem;
}

.wanted:active {
  --tilt: -5deg;
}

.wanted.is-pinned .wanted-stuck {
  visibility: visible;
}

@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  .wanted.is-hit .wanted-arrow {
    visibility: visible;
    animation: wanted-fly 0.42s cubic-bezier(0.3, 0.05, 0.6, 1) both;
  }

  .wanted.is-pinned .wanted-arrow {
    visibility: hidden;
  }

  .wanted.is-pinned {
    animation: wanted-thud 0.45s ease-out both;
  }

  .wanted.is-pinned .wanted-stuck {
    animation: wanted-quiver 0.45s ease-out both;
    transform-origin: 0 100%;
  }
}

@keyframes wanted-fly {
  from { transform: translateX(-110vw) rotate(-3deg); }
  to { transform: none; }
}

@keyframes wanted-thud {
  0% { transform: rotate(var(--tilt)) translate(0, 0); }
  25% { transform: rotate(calc(var(--tilt) + 2.5deg)) translate(0.5rem, 0.15rem); }
  55% { transform: rotate(calc(var(--tilt) - 1deg)) translate(-0.15rem, 0); }
  100% { transform: rotate(var(--tilt)); }
}

@keyframes wanted-quiver {
  0% { transform: rotate(-9deg); }
  30% { transform: rotate(6deg); }
  55% { transform: rotate(-3deg); }
  80% { transform: rotate(1.5deg); }
  100% { transform: none; }
}

@media (max-width: 760px) {
  .wanted-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .wanted-copy {
    position: relative;
    z-index: 2;
  }

  .wanted-tree {
    inline-size: min(100%, 21rem);
  }
}

@media (forced-colors: active) {
  .wanted-paper {
    border: 2px solid CanvasText;
    background: Canvas;
  }
}

/* The weather (rain streaks, lichen, mud, rust from the nail) is painted into poster.webp; the
   ink only sits in the paper and has bled a little. */
.wanted-paper > :not(.wanted-paper-image):not(noscript) {
  position: relative;
  z-index: 1;
  mix-blend-mode: multiply;
  text-shadow: 0 0 0.05em rgb(43 26 16 / 0.6);
}

/* The tree the notice is nailed to: a trunk wider than the poster, cut by the section's edges. */
.wanted-section {
  overflow: clip;
}

.wanted-tree {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  inline-size: min(100%, 26rem);
  padding-block: 2rem;
}

.wanted-trunk {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  z-index: 0;
  inline-size: 150%;
  max-inline-size: none;
  block-size: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.wanted-stamp {
  z-index: 1;
}

.wanted-arrow,
.wanted-stuck {
  z-index: 3;
}


@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  .wanted { transition: none; }
  .wanted:hover, .wanted:focus-visible, .wanted:active { --tilt: -7deg; }
}

@media (forced-colors: active) {
  .wanted-paper-image { display: none; }
}
