/* The Friendship Company: the Irvine dusk painting, paper-colored type set
   like the logo, and Arne's signature on request. */
@font-face {
  font-family: 'Friendship Cormorant';
  src: url('/fonts/signoffs/friendship-cormorant.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

/* Taller than the default so the painting keeps its sky, which is what lets
   the page dissolve into it: the eased mask spends its first half fading in
   sky only, so no tree or palm ever starts at an edge. */
[data-signoff='friendship'] {
  --b-height: clamp(250px, 26vw, 380px);
  --b-height-m: 300px;
  --fr-paper: #f7f2e8;
  --fr-fit: 0.06;
}
[data-signoff='friendship'] .fr-dusk {
  -webkit-mask-image: linear-gradient(
    #0000 0%,
    #00000008 8%,
    #0000001c 16%,
    #00000038 24%,
    #0000005e 32%,
    #0000008c 40%,
    #000000ba 48%,
    #000000de 56%,
    #000000f5 64%,
    #000 72%
  );
  mask-image: linear-gradient(
    #0000 0%,
    #00000008 8%,
    #0000001c 16%,
    #00000038 24%,
    #0000005e 32%,
    #0000008c 40%,
    #000000ba 48%,
    #000000de 56%,
    #000000f5 64%,
    #000 72%
  );
}

/* The painting starts a little sepia, like the site's undeveloped postcard.
   Hovering anywhere on the band develops it, as on the site. */
[data-signoff='friendship'] .fr-dusk {
  background: #31435a;
}
[data-signoff='friendship'] .fr-dusk::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/images/projects/footers/friendship/dusk-wide.webp') 50%
    100% / cover no-repeat;
  filter: sepia(0.3) saturate(0.9);
  transition: filter 1.6s ease;
}
[data-signoff='friendship']:hover .fr-dusk::before {
  filter: none;
}
@media (hover: none) {
  [data-signoff='friendship'] .fr-dusk::before {
    filter: none;
  }
}

/* A clip layer, not a scroll box: the cropped name hangs past the band's
   bottom edge, and without this, focusing it would scroll the band. */
[data-signoff='friendship'] .fr-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: clip;
  pointer-events: none;
}
[data-signoff='friendship'] .fr-name {
  pointer-events: auto;
}

[data-signoff='friendship'] .fr-name {
  position: absolute;
  z-index: 1;
  left: var(--f-gutter);
  right: var(--f-gutter);
  bottom: 0;
  translate: 0 14%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fr-paper);
  font-family: 'Friendship Cormorant', var(--s-serif, serif);
  font-weight: 500;
  font-size: calc((100cqw - 2 * var(--f-gutter)) * var(--fr-fit));
  line-height: 1;
  letter-spacing: 0.14em;
  text-shadow: 0 2px 24px #0b141f59;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
[data-signoff='friendship'] .fr-name:focus-visible {
  outline: 1px solid var(--fr-paper);
  outline-offset: 8px;
}
[data-signoff='friendship'] .fr-name-line {
  display: flex;
  justify-content: center;
  gap: 0.42em;
  white-space: nowrap;
}
/* Tracking leaves a gap after the last letter; this pulls it back so the
   line sits centered. */
[data-signoff='friendship'] .fr-word {
  margin-right: -0.14em;
}

/* Each mask stroke sweeps along its pen stroke, so the ink appears in the
   order the pen moved. */
[data-signoff='friendship'] .fr-signature {
  position: absolute;
  z-index: 1;
  right: calc(var(--f-gutter) + 2%);
  bottom: calc((100cqw - 2 * var(--f-gutter)) * var(--fr-fit) + 10%);
  width: clamp(150px, 17vw, 240px);
  height: auto;
  rotate: -4deg;
  color: var(--fr-paper);
  filter: drop-shadow(0 2px 10px #0b141f66);
  pointer-events: none;
}
[data-signoff='friendship'] .fr-signature mask path {
  stroke-dasharray: 1.02 1.02;
  stroke-dashoffset: 1.02;
  animation-name: fr-pen;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes fr-pen {
  to {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 640px) {
  [data-signoff='friendship'] .fr-dusk::before {
    background-image: url('/images/projects/footers/friendship/dusk-narrow.webp');
  }
  /* On a phone the name stacks the way the logo does. */
  [data-signoff='friendship'] .fr-name {
    translate: 0 4%;
    font-size: 34px;
    letter-spacing: 0.12em;
  }
  [data-signoff='friendship'] .fr-name-line {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  [data-signoff='friendship'] .fr-word {
    margin-right: -0.12em;
  }
  [data-signoff='friendship'] .fr-word[data-first] {
    font-size: 0.5em;
    letter-spacing: 0.3em;
  }
  [data-signoff='friendship'] .fr-signature {
    right: var(--f-gutter);
    bottom: 112px;
    width: 120px;
  }
}
