.master-footer {
  display: block;
  border-top: 0;
  padding: 0 clamp(0.75rem, 2vw, 1.5rem) clamp(0.75rem, 2vw, 1.5rem);
}

.footer-well {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(91, 29, 29, 0.1);
  border-radius: clamp(2rem, 4vw, 3.5rem);
  corner-shape: squircle;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.2rem, 5vw, 5.5rem) clamp(1.4rem, 3vw, 2.25rem);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 250, 240, 0.72), transparent 28rem),
    linear-gradient(145deg, rgba(232, 222, 202, 0.9), rgba(214, 205, 192, 0.72));
  box-shadow:
    inset 0 1.6rem 3.6rem rgba(63, 17, 17, 0.13),
    inset 0 2px 1px rgba(255, 250, 240, 0.82),
    inset 0 -1px 0 rgba(91, 29, 29, 0.1),
    0 1px 0 rgba(255, 250, 240, 0.8);
}

.footer-well::before,
.footer-well::after {
  position: absolute;
  z-index: 0;
  width: clamp(14rem, 34vw, 32rem);
  height: clamp(14rem, 34vw, 32rem);
  border: 1px solid rgba(91, 29, 29, 0.07);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.footer-well::before {
  top: -22%;
  left: -10%;
}

.footer-well::after {
  right: -12%;
  bottom: -35%;
}

.footer-well > * {
  position: relative;
  z-index: 1;
}

.footer-navigation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem clamp(2rem, 6vw, 6.5rem);
  width: min(100%, 69rem);
  margin: 0 auto;
}

body[data-authenticated="true"] .footer-navigation {
  width: min(100%, 48rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer-link-group {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.62rem;
}

.footer-link-group > p {
  margin: 0 0 0.35rem;
  color: var(--color-deep-wine);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.footer-link-group a {
  color: var(--color-charcoal);
  font-size: 0.83rem;
  text-decoration-color: transparent;
  text-underline-offset: 0.25rem;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.footer-link-group a:hover {
  color: var(--color-deep-wine);
  text-decoration-color: currentColor;
}

.footer-link-group a small,
.footer-legal a small {
  margin-left: 0.35rem;
  color: var(--color-copper);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-invitation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem 4rem;
  align-items: center;
  width: min(100%, 69rem);
  margin: clamp(3rem, 6vw, 5rem) auto 0;
  border: 1px solid rgba(91, 29, 29, 0.12);
  border-radius: 2rem;
  corner-shape: squircle;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: rgba(232, 222, 202, 0.62);
  box-shadow:
    inset 0 0.85rem 1.8rem rgba(63, 17, 17, 0.1),
    inset 0 -1px 0 rgba(255, 250, 240, 0.74);
}

.footer-invitation-label {
  margin: 0 0 0.5rem;
  color: var(--color-deep-wine);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.footer-invitation h2 {
  margin: 0;
  color: var(--color-deep-wine);
  font-family: var(--font-headline);
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.15;
}

.footer-invitation div > p:last-child {
  margin: 0.65rem 0 0;
  color: var(--color-muted-ink);
  font-size: 0.82rem;
}

.footer-invitation-actions {
  display: flex;
  width: min(100%, 15rem);
  align-items: center;
  flex-direction: column;
  gap: 1rem;
  justify-self: center;
}

body[data-authenticated="true"] .footer-invitation-actions[data-member-only] {
  display: flex;
}

.footer-invitation-actions .footer-button {
  width: 100%;
}

.footer-button {
  display: inline-flex;
  min-height: 3.2rem;
  align-items: center;
  justify-content: center;
  border-radius: 1.15rem;
  corner-shape: squircle;
  padding: 0.85rem 1.4rem;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-decoration: none;
  text-transform: uppercase;
}

.footer-button-primary {
  border: 1px solid var(--color-deep-wine);
  background: var(--color-deep-wine);
  color: var(--color-ivory);
  box-shadow: 0 0.55rem 1.1rem rgba(63, 17, 17, 0.14);
  transition: background 160ms ease, transform 160ms ease;
}

.footer-button-primary:hover {
  background: var(--color-deep-wine-hover);
  transform: translateY(-1px);
}

.footer-button-secondary {
  border: 1px solid rgba(91, 29, 29, 0.2);
  background: rgba(246, 241, 230, 0.42);
  color: var(--color-deep-wine);
  box-shadow:
    inset 0 0.5rem 1rem rgba(63, 17, 17, 0.08),
    inset 0 -1px 0 rgba(255, 250, 240, 0.78);
  transition: background 160ms ease, transform 160ms ease;
}

.footer-button-secondary:hover {
  background: rgba(255, 250, 240, 0.68);
  transform: translateY(-1px);
}

.footer-text-link {
  color: var(--color-deep-wine);
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.footer-action-reset {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.footer-colophon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1.25rem 2rem;
  align-items: center;
  width: min(100%, 69rem);
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
  border-top: 1px solid rgba(91, 29, 29, 0.14);
  padding-top: 1.5rem;
  color: var(--color-muted-ink);
  font-size: 0.65rem;
}

.footer-colophon > p {
  margin: 0;
}

.footer-legal,
.footer-social {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
}

.footer-legal a {
  color: var(--color-deep-wine);
  font-weight: 700;
  text-underline-offset: 0.18rem;
}

.footer-social {
  justify-content: flex-end;
  gap: 0.35rem;
}

.footer-social-mobile {
  display: none;
}

.footer-social a {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid rgba(91, 29, 29, 0.16);
  border-radius: 50%;
  background: rgba(246, 241, 230, 0.32);
  color: var(--color-deep-wine);
  text-decoration: none;
  box-shadow:
    inset 0 0.42rem 0.9rem rgba(63, 17, 17, 0.08),
    inset 0 -1px 0 rgba(255, 250, 240, 0.8);
  transition: background 160ms ease, color 160ms ease;
}

.footer-social a:hover {
  background: rgba(255, 250, 240, 0.6);
}

.footer-social img {
  display: block;
  width: 1rem;
  height: 1rem;
}

[data-member-only] {
  display: none;
}

body[data-authenticated="true"] [data-member-only] {
  display: block;
}

body[data-authenticated="true"] [data-visitor-only] {
  display: none;
}

@media (max-width: 820px) {
  .footer-navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-link-group:last-child {
    grid-column: 1 / -1;
  }

  body[data-authenticated="true"] .footer-navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-authenticated="true"] .footer-link-group:last-child {
    grid-column: auto;
  }

  .footer-invitation {
    grid-template-columns: 1fr;
  }

  .footer-invitation-actions {
    align-items: center;
    justify-self: center;
  }

  .footer-text-link {
    text-align: center;
  }

  .footer-colophon {
    grid-template-columns: 1fr auto;
  }

  .footer-legal {
    justify-content: flex-end;
  }

  .footer-social {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .master-footer {
    padding-inline: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .footer-well {
    border-radius: 2.15rem;
    padding: 2.3rem 1.05rem 1.15rem;
  }

  .footer-navigation {
    grid-template-columns: 1fr;
    width: calc(100% - 1.1rem);
  }

  body[data-authenticated="true"] .footer-navigation {
    width: calc(100% - 1.1rem);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }

  body[data-authenticated="true"] .footer-link-group {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .footer-link-group {
    border-bottom: 1px solid rgba(91, 29, 29, 0.11);
    padding-bottom: 1.5rem;
  }

  .footer-link-group:last-child {
    grid-column: auto;
    border-bottom: 0;
    padding-bottom: 0;
  }

  .footer-invitation {
    width: 100%;
    border-radius: 1.6rem;
    padding: 1.45rem;
  }

  .footer-invitation-actions,
  .footer-button {
    width: 100%;
  }

  .footer-invitation-actions {
    align-items: center;
    gap: 1.15rem;
  }

  .footer-text-link {
    text-align: center;
  }

  .footer-colophon {
    grid-template-columns: 1fr;
    width: calc(100% - 1.1rem);
    justify-items: center;
    text-align: center;
  }

  .footer-legal {
    justify-content: center;
    flex-wrap: wrap;
  }

  .footer-social {
    grid-column: auto;
    justify-content: center;
  }

  .footer-social-desktop {
    display: none;
  }

  .footer-social-mobile {
    display: flex;
    width: max-content;
    margin: 2rem auto 0;
  }

  .footer-social-mobile + .footer-invitation {
    margin-top: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer-link-group a,
  .footer-button,
  .footer-social a {
    transition: none;
  }
}
