:root {
  --ink: #29241f;
  --paper: #f3eee5;
  --paper-deep: #e7ddce;
  --copper: #a75f3c;
  --copper-dark: #82462c;
  --line: rgba(41, 36, 31, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "merriweather-light", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.farewell {
  display: grid;
  grid-template-columns: minmax(34rem, 1.05fr) minmax(28rem, 0.95fr);
  min-height: 100svh;
  overflow: hidden;
}

.farewell__message {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: clamp(2rem, 5vw, 5.5rem) clamp(2rem, 6vw, 6.5rem) 2.25rem;
  background:
    linear-gradient(115deg, transparent 0 78%, rgba(167, 95, 60, 0.07) 78%),
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.75), transparent 28rem),
    var(--paper);
}

.farewell__message::after {
  position: absolute;
  right: -3.75rem;
  top: 0;
  bottom: 0;
  z-index: -1;
  width: 7.5rem;
  content: "";
  background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 51% 100%, 0 100%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  width: fit-content;
  color: var(--ink);
}

.brand__mark {
  display: grid;
  gap: 3px;
  width: 2.25rem;
  transform: rotate(-8deg);
}

.brand__mark span {
  display: block;
  height: 1px;
  background: var(--copper);
}

.brand__mark span:nth-child(2) {
  transform: translateX(0.28rem);
}

.brand__mark span:nth-child(3) {
  transform: translateX(-0.16rem);
}

.brand__name {
  font-family: "raleway-bold", sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.message {
  width: min(100%, 37rem);
  margin: auto 0;
  padding: 4.5rem 0 3.5rem;
}

.eyebrow {
  margin: 0 0 1.4rem;
  color: var(--copper-dark);
  font-family: "raleway-bold", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1 {
  max-width: 8ch;
  margin: 0 0 2rem;
  font-family: "merriweather-regular", Georgia, serif;
  font-size: clamp(3.6rem, 7.4vw, 7.4rem);
  font-weight: normal;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.message p {
  max-width: 36rem;
  margin: 0 0 1.1rem;
  font-size: clamp(0.98rem, 1.2vw, 1.12rem);
  line-height: 1.8;
}

.message .message__lead {
  margin-bottom: 1rem;
  font-family: "merriweather-regular", Georgia, serif;
  font-size: clamp(1.18rem, 1.7vw, 1.5rem);
  line-height: 1.55;
}

.referral {
  position: relative;
  margin-top: 2.3rem;
  padding: 1.55rem 1.7rem 1.7rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.26);
}

.referral::before {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 3.5rem;
  height: 3px;
  content: "";
  background: var(--copper);
}

.referral .referral__label {
  margin-bottom: 0.35rem;
  font-family: "raleway-bold", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.referral p {
  margin-bottom: 1.15rem;
  font-size: 0.96rem;
  line-height: 1.6;
}

.referral__link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid currentColor;
  color: var(--copper-dark);
  font-family: "raleway-bold", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease, gap 180ms ease;
}

.referral__link svg {
  width: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.referral__link:hover {
  gap: 1.05rem;
  color: var(--ink);
}

.referral__link:focus-visible {
  outline: 3px solid rgba(167, 95, 60, 0.35);
  outline-offset: 6px;
}

footer {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  color: rgba(41, 36, 31, 0.6);
  font-family: "raleway-medium", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.farewell__image {
  position: relative;
  min-height: 100svh;
  background:
    linear-gradient(180deg, rgba(20, 17, 14, 0.08), rgba(20, 17, 14, 0.55)),
    url("../images/photo-1465847899084-d164df4dedc6.jpg") center / cover no-repeat;
}

.farewell__image::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(105deg, rgba(80, 39, 20, 0.13), transparent 45%);
  mix-blend-mode: color;
}

.image__caption {
  position: absolute;
  right: clamp(1.5rem, 4vw, 4rem);
  bottom: clamp(2rem, 5vw, 4.5rem);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: #f7f0e5;
  font-family: "merriweather-light-italic", Georgia, serif;
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.55;
  text-shadow: 0 2px 20px rgba(20, 17, 14, 0.55);
}

@media (prefers-reduced-motion: no-preference) {
  .brand,
  .message > *,
  footer,
  .image__caption {
    animation: reveal 700ms both;
  }

  .message > :nth-child(1) { animation-delay: 100ms; }
  .message > :nth-child(2) { animation-delay: 170ms; }
  .message > :nth-child(3) { animation-delay: 240ms; }
  .message > :nth-child(4) { animation-delay: 310ms; }
  .message > :nth-child(5) { animation-delay: 380ms; }
  footer { animation-delay: 470ms; }
  .image__caption { animation-delay: 550ms; }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (max-width: 960px) {
  .farewell {
    grid-template-columns: 1fr;
  }

  .farewell__message {
    min-height: auto;
    padding: 2rem clamp(1.5rem, 8vw, 5rem) 2.25rem;
  }

  .farewell__message::after {
    display: none;
  }

  .message {
    padding: clamp(4.5rem, 12vw, 7rem) 0;
  }

  h1 {
    font-size: clamp(3.8rem, 13vw, 7rem);
  }

  .farewell__image {
    min-height: 54svh;
    background-position: 42% center;
  }
}

@media (max-width: 520px) {
  .farewell__message {
    padding-inline: 1.35rem;
  }

  .message {
    padding: 4.5rem 0 4rem;
  }

  h1 {
    font-size: clamp(3.4rem, 17vw, 5rem);
  }

  .referral {
    padding: 1.35rem;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.3rem;
  }

  footer span:nth-child(2) {
    display: none;
  }
}
