/* Shared portfolio footer. Keep its layout independent of case-study styles. */
.site-footer[data-footer-contours] {
  margin: 0;
  padding: 6rem 2rem 2.5rem;
  width: 100%;
  border-top: 1px solid rgb(0 0 0 / 8%);
  color: #1f2a24;
  font: 400 1rem/1.5 var(--font-family-body, "Jost", sans-serif);
  text-align: left;
}

.site-footer[data-footer-contours] .site-footer-inner {
  width: min(100%, 1200px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.site-footer[data-footer-contours] .site-footer-top { max-width: 700px; }
.site-footer[data-footer-contours] p { margin: 0; }
.site-footer[data-footer-contours] .site-footer-eyebrow {
  margin-bottom: .75rem;
  font-size: .95rem;
  line-height: 1.4;
}
.site-footer[data-footer-contours] .site-footer-heading {
  margin: 0 0 1rem;
  color: #1f2a24;
  font: 400 clamp(2rem, 4vw, 3.5rem)/1.05 var(--font-family-heading, "Jost", sans-serif);
  letter-spacing: normal;
  text-wrap: wrap;
}
.site-footer[data-footer-contours] .site-footer-copy {
  max-width: 56ch;
  font-size: 1.05rem;
  line-height: 1.6;
}
.site-footer[data-footer-contours] .site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer[data-footer-contours] .site-footer-links li { margin: 0; padding: 0; }
.site-footer[data-footer-contours] a {
  color: #1f2a24;
  font-weight: 400;
  text-decoration: none;
}
.site-footer[data-footer-contours] a:hover {
  color: #4d6b5d;
  text-decoration: underline;
  text-underline-offset: .22em;
}
.site-footer[data-footer-contours] a:focus-visible {
  outline: 2px solid #1f2a24;
  outline-offset: 5px;
  border-radius: 2px;
}
.site-footer[data-footer-contours] .site-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(40 75 52 / 14%);
}
.site-footer[data-footer-contours] .site-footer-small { font-size: .9rem; }

/* Keep the footer full width on the older padded gallery layout too. */
body.padding-large > .site-footer[data-footer-contours] {
  --footer-page-inset: var(--padding-small, 1rem);
  width: calc(100% + 2 * var(--footer-page-inset));
  margin-inline: calc(-1 * var(--footer-page-inset));
  margin-bottom: calc(-1 * var(--footer-page-inset));
}
@media (min-width: 992px) {
  body.padding-large > .site-footer[data-footer-contours] { --footer-page-inset: var(--padding-large, 3rem); }
}

/* A quiet, full-width contour field behind the text. */
[data-footer-contours] {
  --footer-light-radius: clamp(260px, 45vw, 600px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  background: #ebf7f1;
}

[data-footer-contours] > .footer-contours-layer {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

[data-footer-contours] > :not(.footer-contours-layer) {
  position: relative;
  z-index: 1;
}

.footer-contours-wash,
.footer-contours-photo,
.footer-contours-base,
.footer-contours-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.footer-contours-wash {
  background: radial-gradient(
    var(--footer-light-radius) circle at var(--footer-light-x, 50%) var(--footer-light-y, 45%),
    rgb(111 179 150 / 14%) 0%,
    rgb(126 167 190 / 8%) 42%,
    rgb(126 167 190 / 2%) 70%,
    transparent 100%
  );
}

/* This photo shares the artwork's crop, but never follows or deforms with the cursor. */
.footer-contours-photo {
  background: url('../assets/footer-terrain/lions-photo.svg?v=592cb4c2c00e') center / max(100%, 720px) 100% no-repeat;
  opacity: .12;
  filter: grayscale(1);
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(180deg, transparent 2%, #000 24%, #000 45%, transparent 94%);
  mask-image: linear-gradient(180deg, transparent 2%, #000 24%, #000 45%, transparent 94%);
}

.footer-contours-base,
.footer-contours-light {
  -webkit-mask-image: url('../assets/footer-terrain/contours-wide.svg');
  mask-image: url('../assets/footer-terrain/contours-wide.svg');
  -webkit-mask-size: max(100%, 720px) 100%;
  mask-size: max(100%, 720px) 100%;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.footer-contours-base {
  background: #356b4f;
  opacity: .1;
}

.footer-contours-light {
  background: radial-gradient(
    var(--footer-light-radius) circle at var(--footer-light-x, 50%) var(--footer-light-y, 45%),
    rgb(49 93 67 / 18%) 0%,
    rgb(65 107 81 / 9%) 42%,
    transparent 100%
  );
}

.footer-contours-deform-svg {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}

.footer-contours-deform-ready :is(.footer-contours-base, .footer-contours-light) { visibility: hidden; }
.footer-contours-deform-ready .footer-contours-deform-svg { display: block; }

[data-footer-art="growth-rings"] .footer-contours-deform-svg {
  -webkit-mask-image: none;
  mask-image: none;
}

@media (prefers-reduced-motion: reduce), (hover: none), (pointer: coarse) {
  .footer-contours-deform-ready :is(.footer-contours-base, .footer-contours-light) { visibility: visible; }
  .footer-contours-deform-ready .footer-contours-deform-svg { display: none; }
}

[data-footer-contours] .site-footer-copy {
  color: #304b39;
  opacity: 1;
}

[data-footer-contours] :is(.site-footer-eyebrow, .site-footer-small) {
  color: #3c5445;
  opacity: 1;
}

[data-footer-contours] .site-footer-bottom {
  border-top-color: rgb(40 75 52 / 14%);
}

@media (max-width: 768px) {
  .site-footer[data-footer-contours] { padding: 4rem 1.25rem 2rem; }
  .site-footer[data-footer-contours] .site-footer-bottom { flex-direction: column; align-items: flex-start; }

  /* Keep the Lions in proportion as the footer content stacks on mobile. */
  [data-footer-contours]:not([data-footer-art="growth-rings"]) .footer-contours-photo {
    background-size: max(100%, 720px) auto;
    background-position: center bottom;
  }
  [data-footer-contours]:not([data-footer-art="growth-rings"]) :is(.footer-contours-base, .footer-contours-light) {
    -webkit-mask-size: max(100%, 720px) auto;
    mask-size: max(100%, 720px) auto;
    -webkit-mask-position: center bottom;
    mask-position: center bottom;
  }
}

@media (max-width: 640px) {
  .site-footer[data-footer-contours] a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-contours-base { opacity: .075; }
  .footer-contours-light { opacity: .75; }
}

@media (forced-colors: active), print {
  [data-footer-contours] > .footer-contours-layer { display: none; }
  [data-footer-contours] { background: Canvas; }
  .site-footer[data-footer-contours] :is(.site-footer-heading, a) { color: CanvasText; }
  [data-footer-contours] :is(.site-footer-copy, .site-footer-eyebrow, .site-footer-small) { color: CanvasText; }
}
