/* Donation section, contact section, question-envelope animation, footer, and document-source callouts. */
.donate {
  width: 100%;
  position: relative;
  overflow: hidden;
  padding-right: max(20px, calc((100% - var(--max)) / 2));
  padding-left: max(20px, calc((100% - var(--max)) / 2));
  background: var(--pattern-donate);
  background-position: center, 0 0, 100% 100%, 0 0;
  background-size: 420px 260px, auto, auto, auto;
  border-top: 1px solid rgba(47, 109, 85, 0.16);
  border-bottom: 1px solid rgba(47, 109, 85, 0.14);
}

.donate::before {
  position: absolute;
  inset: 18px auto auto max(20px, calc((100% - var(--max)) / 2));
  width: 128px;
  height: 128px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px dashed rgba(47, 109, 85, 0.22);
  border-radius: 50%;
  content: "";
}

.donate-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.donate-copy {
  display: grid;
  gap: 22px;
  max-width: 710px;
  padding: 0;
}

.donate-copy h2 {
  max-width: 650px;
}

.donate-copy > p:not(.section-kicker) {
  max-width: 620px;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.donate-impact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.donate-impact article {
  min-width: 0;
  min-height: 146px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 252, 238, 0.96)),
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(13, 111, 167, 0.1) 28px 29px);
  border: 1px solid rgba(201, 151, 53, 0.32);
  border-top: 5px solid var(--green);
  border-radius: var(--radius);
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.08);
}

.donate-impact article:nth-child(2) {
  border-top-color: var(--gold);
}

.donate-impact article:nth-child(3) {
  border-top-color: var(--blue);
}

.donate-impact strong {
  color: var(--navy);
  font-size: 0.98rem;
  line-height: 1.18;
}

.donate-impact span {
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.45;
}

.donate-media-panel {
  position: relative;
  display: grid;
  justify-items: end;
  gap: 16px;
}

.donate-note {
  width: min(360px, 100%);
  margin: 0;
  padding: 12px 14px;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(47, 109, 85, 0.18);
  border-left: 5px solid var(--green);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.donate-gallery {
  position: relative;
  width: min(360px, 100%);
  justify-self: end;
  padding: 10px;
  background: var(--white);
  border: 1px solid rgba(47, 109, 85, 0.2);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-lg);
  transform: rotate(1.2deg);
}

.donate-gallery::before {
  position: absolute;
  top: -16px;
  left: 50%;
  width: 142px;
  height: 34px;
  background: rgba(223, 244, 241, 0.86);
  border: 1px solid rgba(13, 111, 167, 0.12);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
  content: "";
  transform: translateX(-50%) rotate(-1.5deg);
}

.donate-gallery img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.1);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.document-source {
  margin: 10px 0 0;
  color: rgba(16, 38, 61, 0.68);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.45;
}

.document-source a {
  color: var(--blue);
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.enrollment-form-heading .document-source {
  color: rgba(16, 38, 61, 0.68);
}

.resource-source {
  max-width: var(--content-width);
  margin: 18px auto 0;
  padding: 0 4px;
}

.donate-button,
.donate-button:visited {
  position: relative;
  gap: 10px;
  min-height: 52px;
  padding: 12px 18px 12px 14px;
  overflow: hidden;
  color: var(--white);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 16px 28px rgba(16, 38, 61, 0.16);
}

.donate-button::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 46%);
  content: "";
  pointer-events: none;
}

.donate-button > span {
  position: relative;
  z-index: 1;
}

.donate-button-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  font-weight: 950;
  line-height: 1;
  border-radius: 7px;
}

.donate-button-cashapp,
.donate-button-cashapp:visited {
  background: linear-gradient(135deg, #00d632, #00a83b);
  box-shadow: 0 16px 30px rgba(0, 168, 59, 0.24);
}

.donate-button-cashapp .donate-button-mark {
  color: #00a83b;
  background: var(--white);
}

.donate-button-cashapp:hover,
.donate-button-cashapp:focus-visible {
  background: linear-gradient(135deg, #00be2d, #008f34);
}

.contact {
  padding: 76px 0;
  color: var(--white);
  background: var(--pattern-contact);
  background-size: 36px 36px, 36px 36px, auto, auto;
}

.contact-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(360px, 0.9fr);
  gap: 48px;
  align-items: start;
}

.contact-copy {
  display: grid;
  gap: 18px;
}

.contact h2 {
  color: var(--white);
}

.contact-copy > p {
  max-width: 58ch;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 750;
  line-height: 1.7;
}

.contact address {
  display: grid;
  gap: 8px;
  font-style: normal;
}

.contact address a {
  padding: 14px 0;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 950;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.contact address a:hover,
.contact address a:focus-visible {
  color: var(--gold);
  outline: none;
}

.contact-form-card {
  scroll-margin-top: var(--anchor-scroll-margin);
  position: relative;
  color: var(--ink);
}

.contact-form-paper {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 30px;
  background:
    linear-gradient(90deg, rgba(200, 63, 61, 0.12) 0 2px, transparent 2px 100%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(13, 111, 167, 0.09) 31px 32px),
    linear-gradient(180deg, #fffdf8, #f8fcff);
  background-position: 32px 0, 0 10px, 0 0;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: var(--radius);
  box-shadow:
    0 24px 56px rgba(16, 38, 61, 0.26),
    inset 0 1px rgba(255, 255, 255, 0.86);
}

.contact-form-paper::before {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 118px;
  height: 29px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.04)),
    rgba(223, 244, 241, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.64);
  box-shadow: 0 8px 18px rgba(16, 38, 61, 0.12);
  content: "";
  transform: translateX(-50%) rotate(2deg);
}

.contact-form-paper > * {
  position: relative;
  z-index: 1;
}

.contact-form-heading,
.contact-form-message,
.contact-form-actions {
  grid-column: 1 / -1;
}

.contact-form-heading {
  padding-bottom: 4px;
}

.contact-form-heading .section-kicker {
  color: var(--green);
}

.contact-form-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.45rem, 3vw, 2.08rem);
  line-height: 1.08;
}

.contact-form-card label {
  display: grid;
  gap: 8px;
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 950;
  text-transform: uppercase;
}

.contact-form-card input,
.contact-form-card select,
.contact-form-card textarea {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(16, 38, 61, 0.18);
  border-radius: 12px;
  font: inherit;
  text-transform: none;
}

.contact-form-card input:focus,
.contact-form-card select:focus,
.contact-form-card textarea:focus {
  border-color: rgba(13, 111, 167, 0.56);
  outline: 3px solid rgba(13, 111, 167, 0.16);
}

.contact-form-card textarea {
  resize: vertical;
}

.contact-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.contact-form-status {
  margin: 0;
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 850;
}

.contact-form-status.is-error {
  color: var(--coral-dark);
}

.contact-form-card.is-envelope-sending {
  overflow: visible;
}

.contact-form-card.is-envelope-sending.has-contact-paper-flight > .contact-form-paper {
  visibility: hidden;
  pointer-events: none;
}

.contact-form-card.is-envelope-restoring .contact-form-paper {
  animation: contactFormRestore 0.52s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.contact-form-card.is-contact-success .contact-form-paper {
  display: none;
}

.contact-paper-flight {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  perspective: 1200px;
  transform-origin: 50% 25%;
  transform-style: preserve-3d;
}

.contact-form-card.is-envelope-sending .contact-paper-flight {
  animation: contactFoldedPaperSlide 4.8s cubic-bezier(0.18, 0.78, 0.18, 1) both;
}

.contact-paper-half {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--contact-paper-half-height);
  overflow: hidden;
  background: #fffdf8;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.contact-paper-half--top {
  top: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 18px 28px rgba(16, 38, 61, 0.13);
}

.contact-paper-half--bottom {
  top: var(--contact-paper-half-height);
  border-radius: 0 0 var(--radius) var(--radius);
  transform-origin: 50% 0;
}

.contact-paper-half--bottom::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(16, 38, 61, 0.12), rgba(255, 255, 255, 0.18) 24%, rgba(16, 38, 61, 0.1));
  content: "";
  opacity: 0;
}

.contact-form-card.is-envelope-sending .contact-paper-half--bottom {
  animation: contactPaperBottomFold 4.8s cubic-bezier(0.22, 0.84, 0.22, 1) both;
}

.contact-form-card.is-envelope-sending .contact-paper-half--bottom::after {
  animation: contactPaperFoldShadow 4.8s ease both;
}

.contact-form-paper-clone {
  width: 100%;
  height: var(--contact-paper-height);
  min-height: var(--contact-paper-height);
  box-sizing: border-box;
  box-shadow: none;
}

.contact-envelope-success {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: block;
  pointer-events: none;
  perspective: 900px;
}

.contact-envelope-success[hidden] {
  display: none;
}

.contact-envelope-back,
.contact-envelope-front,
.contact-envelope-flap {
  position: absolute;
  left: 50%;
  top: var(--contact-envelope-top, 58%);
  width: var(--contact-envelope-width, 100%);
  height: var(--contact-envelope-height, 230px);
  min-height: 0;
  border-radius: 18px;
  transform-origin: 50% 60%;
  animation: contactEnvelopeAppearCloseFly 4.8s cubic-bezier(0.18, 0.78, 0.24, 1) both;
}

.contact-envelope-back {
  z-index: 1;
  background:
    linear-gradient(180deg, #fffdf4 0%, #fff1c8 100%);
  border: 1px solid rgba(190, 136, 42, 0.42);
  box-shadow:
    0 26px 48px rgba(16, 38, 61, 0.28),
    inset 0 1px rgba(255, 255, 255, 0.82);
}

.contact-envelope-front {
  z-index: 3;
  background:
    linear-gradient(150deg, #ffcf6c, #fff7dc 54%, #efc468);
  clip-path: polygon(0 30%, 50% 66%, 100% 30%, 100% 100%, 0 100%);
  filter: drop-shadow(0 -2px 0 rgba(190, 136, 42, 0.18));
  overflow: hidden;
}

.contact-envelope-front::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(155deg, #fff7dd, #ffd374 54%, #deb451);
  clip-path: polygon(0 30%, 50% 66%, 100% 30%);
  content: "";
}

.contact-envelope-front::after {
  position: absolute;
  right: 9%;
  bottom: 11%;
  width: 28%;
  height: 2px;
  background:
    linear-gradient(90deg, rgba(13, 111, 167, 0.28) 0 48%, transparent 48% 58%, rgba(13, 111, 167, 0.28) 58% 100%);
  border-radius: 999px;
  content: "";
  opacity: 0.72;
}

.contact-envelope-to,
.contact-envelope-from,
.contact-envelope-stamp {
  position: absolute;
  z-index: 2;
  color: var(--navy);
  letter-spacing: 0;
}

.contact-envelope-to,
.contact-envelope-from {
  max-width: 56%;
  padding: 5px 10px;
  background: #fffdf8;
  border: 1px dashed rgba(13, 111, 167, 0.26);
  border-radius: 10px;
  box-shadow: 0 6px 12px rgba(16, 38, 61, 0.08);
  font-weight: 950;
  line-height: 1.1;
  white-space: nowrap;
}

.contact-envelope-to {
  left: 9%;
  bottom: 16%;
  font-size: clamp(0.72rem, 1.7vw, 0.94rem);
  transform: rotate(-1.5deg);
}

.contact-envelope-from {
  right: 9%;
  bottom: 31%;
  color: rgba(16, 38, 61, 0.78);
  font-size: clamp(0.66rem, 1.45vw, 0.82rem);
  transform: rotate(1.3deg);
}

.contact-envelope-stamp {
  right: 7%;
  bottom: 39%;
  display: inline-grid;
  width: clamp(50px, 8vw, 70px);
  aspect-ratio: 3 / 2;
  isolation: isolate;
  place-items: center;
  padding: 5px;
  color: var(--blue);
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 34%),
    linear-gradient(135deg, #ffffff 0%, #eefbff 50%, #d6f1ff 100%);
  border: 2px dashed rgba(13, 111, 167, 0.42);
  border-radius: 16px;
  box-shadow:
    0 7px 14px rgba(16, 38, 61, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -10px 18px rgba(13, 111, 167, 0.08);
  overflow: hidden;
  transform: rotate(4deg);
}

.contact-envelope-stamp::before,
.contact-envelope-stamp::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.contact-envelope-stamp::before {
  z-index: 2;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0) 14%, rgba(255, 255, 255, 0.82) 34%, rgba(255, 255, 255, 0.22) 45%, rgba(255, 255, 255, 0) 61%);
  transform: translateX(-12%) rotate(-3deg);
}

.contact-envelope-stamp::after {
  z-index: 3;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.68),
    inset 0 0 12px rgba(255, 255, 255, 0.32);
}

.contact-envelope-logo-stamp {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.contact-envelope-flap {
  z-index: 4;
  pointer-events: none;
}

.contact-envelope-flap::before {
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 63%;
  background:
    linear-gradient(180deg, #fff9e8 0%, #ffd983 100%);
  clip-path: polygon(0 0, 100% 0, 50% 82%);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 8px 14px rgba(16, 38, 61, 0.12);
  content: "";
  backface-visibility: hidden;
  transform-origin: 50% 0;
  animation: contactEnvelopeFlapOpenClose 4.8s cubic-bezier(0.18, 0.78, 0.24, 1) both;
}

.contact-success-panel {
  position: relative;
  z-index: 7;
  min-height: min(560px, 72vh);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 18px;
  padding: clamp(28px, 6vw, 56px);
  color: var(--navy);
  text-align: center;
  background:
    radial-gradient(circle at 50% 16%, rgba(47, 109, 85, 0.12) 0 90px, transparent 91px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.96));
  border: 1px solid rgba(13, 111, 167, 0.14);
  border-radius: var(--radius);
  box-shadow:
    0 24px 56px rgba(16, 38, 61, 0.22),
    inset 0 1px rgba(255, 255, 255, 0.86);
  animation: contactSuccessReveal 0.56s cubic-bezier(0.2, 0.84, 0.2, 1) both;
}

.contact-success-panel[hidden] {
  display: none;
}

.contact-success-panel > div {
  display: grid;
  gap: 8px;
  max-width: 42ch;
}

.contact-success-panel .section-kicker {
  justify-self: center;
  margin: 0;
  color: var(--green);
}

.contact-success-panel h3,
.contact-success-panel p {
  margin: 0;
}

.contact-success-panel h3 {
  color: var(--navy);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.1;
}

.contact-success-panel p:not(.section-kicker) {
  display: block;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.5;
}

.contact-success-icon {
  position: relative;
  width: 96px;
  height: 96px;
  display: inline-block;
  isolation: isolate;
}

.contact-success-seal {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 84px;
  height: 84px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.36) 0 11px, transparent 12px),
    linear-gradient(145deg, var(--green), #2c9f6b);
  border: 5px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  box-shadow:
    0 16px 34px rgba(47, 109, 85, 0.22),
    inset 0 2px 4px rgba(255, 255, 255, 0.28),
    inset 0 -10px 18px rgba(19, 73, 57, 0.16);
}

.contact-success-seal::before,
.contact-success-seal::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.contact-success-seal::before {
  display: none;
}

.contact-success-seal::after {
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.08);
}

.contact-success-seal img {
  display: none;
}

.contact-success-check {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  padding: 7px;
  color: var(--white);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.3;
}

@keyframes contactPaperBottomFold {
  0% {
    transform: rotateX(0deg);
  }

  22% {
    transform: rotateX(0deg);
  }

  48% {
    transform: rotateX(-176deg);
  }

  100% {
    transform: rotateX(-176deg);
  }
}

@keyframes contactPaperFoldShadow {
  0%,
  18% {
    opacity: 0;
  }

  38% {
    opacity: 0.48;
  }

  100% {
    opacity: 0.2;
  }
}

@keyframes contactFoldedPaperSlide {
  0% {
    opacity: 1;
    filter: none;
    transform: translateY(0) scale(1);
  }

  61% {
    opacity: 1;
    filter: drop-shadow(0 18px 20px rgba(16, 38, 61, 0.12));
    transform: translateY(0) scale(1);
  }

  71%,
  75% {
    opacity: 1;
    visibility: visible;
    transform: translateY(var(--contact-paper-slide-final, 196px)) scale(1);
  }

  76% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(var(--contact-paper-slide-final, 196px)) scale(1);
  }

  100% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(var(--contact-paper-slide-final, 196px)) scale(1);
  }
}

@keyframes contactFormRestore {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes contactEnvelopeFlapOpenClose {
  0%,
  18%,
  76% {
    transform: rotateX(178deg);
  }

  84%,
  100% {
    transform: rotateX(0deg);
  }
}

@keyframes contactSuccessReveal {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes contactEnvelopeAppearCloseFly {
  0%,
  48% {
    opacity: 0;
    transform: translate(-50%, 190px) scale(0.98) rotate(-1deg);
  }

  52% {
    opacity: 1;
  }

  60% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1) rotate(0deg);
  }

  85% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1) rotate(0deg);
  }

  92% {
    opacity: 1;
    transform: translate(-24%, 0) scale(0.98) rotate(1deg);
  }

  100% {
    opacity: 0;
    transform: translate(132%, 0) scale(0.9) rotate(4deg);
  }
}

.footer {
  width: min(var(--max), calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 0.93rem;
}

.footer p {
  margin: 0;
}

.footer a {
  color: var(--navy);
  font-weight: 950;
  text-decoration: none;
}
