/* ──────────────────────────────────────────────────────────
   Global footer — shared across index, case studies, articles.
   Single source of truth for layout, typography, and the
   email/LinkedIn link affordance (hand-drawn border + copy icon).
   ────────────────────────────────────────────────────────── */

footer {
  background: #1b1712;
  color: #f0ebe1;
  padding: 40px 32px 0 32px;
  position: relative;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.footer-left {
  flex: 1;
  padding-bottom: 36px;
}

.footer-portrait {
  width: 280px;
  height: 250px;
  flex-shrink: 0;
  align-self: flex-end;
  display: block;
  margin-right: -16px;
  border-radius: 999px 999px 0 0;
  overflow: hidden;
  opacity: 0.92;
}

.footer-portrait img {
  width: 100%;
  height: 100%;
  display: block;
  filter: contrast(1.04);
  object-fit: cover;
  object-position: center top;
}

.footer-email {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.75rem, 3.4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

/* Link affordance — subtle underline so links read as links (WCAG 1.4.1) */
.footer-email a {
  color: #f0ebe1;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(240, 235, 225, 0.4);
  text-underline-offset: 5px;
  position: relative;
  z-index: 0;
  background: none;
  transition: opacity 0.3s ease;
}

/* Hand-drawn pop-out border that animates in on interaction */
.footer-email a::before {
  content: '';
  position: absolute;
  inset: -6px -16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none' fill='none'%3E%3Cpath d='M4 3C65 1 135 4 196 2C198 17 196 43 197 58C135 56 65 59 4 57C2 43 4 17 4 3Z' stroke='%23f0ebe1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

@media (hover: hover) {
  .footer-email a:hover::before {
    opacity: 1;
  }
  .footer-email a:hover {
    opacity: 1;
    background: none;
  }
}

.footer-email a:active::before {
  opacity: 1;
}

.footer-email a:active {
  opacity: 1;
}

.footer-email a:focus-visible {
  background: none;
  outline-offset: 4px;
}

/* Email mailto: copy-to-clipboard affordance */
.footer-email a[href^="mailto:"] {
  cursor: copy;
}

.footer-email a[href^="mailto:"]::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 18px;
  vertical-align: middle;
  opacity: 0;
  transition: width 0.2s ease, margin-left 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 8.5C12 8 17 8.5 20.5 8C21 11 20.5 17 20.5 20.5C17 21 12 20.5 9 21C8.5 17.5 9 11.5 9 8.5Z' stroke='%23f0ebe1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.5 16L5 5C5 3.5 6 3 7.5 3C10 2.5 14 3.5 16.5 3' stroke='%23f0ebe1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (hover: hover) {
  .footer-email a[href^="mailto:"]:hover::after {
    width: 18px;
    margin-left: 8px;
    opacity: 0.6;
  }
}

.footer-email a[href^="mailto:"].copied::after {
  content: 'copied' !important;
  background: none !important;
  width: auto !important;
  height: auto !important;
  opacity: 1 !important;
  font-family: 'Caveat', cursive;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1;
  color: #f0ebe1;
  margin-left: 10px !important;
  vertical-align: baseline;
}

/* Tagline — bumped opacity from 0.38 to 0.65 (was failing WCAG AA) */
.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  opacity: 0.65;
  letter-spacing: 0.01em;
}

/* ── Tablet ── */
@media (max-width: 1023px) {
  footer {
    padding: 36px 24px 0 24px;
    gap: 24px;
  }
  .footer-left { padding-bottom: 28px; }
  .footer-portrait { width: 200px; height: 180px; }
}

/* ── Mobile ── */
@media (max-width: 767px) {
  footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 20px 0;
    gap: 0;
  }
  .footer-left { padding-bottom: 20px; }
  .footer-portrait {
    width: 130px;
    height: 115px;
    align-self: flex-end;
    margin-right: 0;
  }
  .footer-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
}
