/* ==========================================================================
   Shared across every page (2026-11-05)
   - Donate button in the top bar (always visible, phones too)
   - Page-to-page transition veil
   - Scroll animations that speed up when you scroll fast
   - "Email copied" note
   ========================================================================== */

/* ---------- Donate button (top right of every page) ----------
   Order in the bar: logo ... menu links, Donate, menu button (phones). */
.main-nav .nav-brand { margin-right: auto; }
.main-nav .nav-links { order: 1; margin-left: 0; }
.main-nav .nav-cta { order: 2; }
.main-nav .nav-toggle { order: 3; }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 14px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--cta-bg, #826842);
  color: var(--cta-fg, #faf7f0) !important;
  font-family: 'Lora', Georgia, serif;
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--cta-shadow, rgba(109, 85, 53, .35));
  transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s, background .25s;
}
.nav-cta svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-cta:hover, .nav-cta:focus-visible {
  background: var(--cta-bg-hover, #6d5535);
  color: var(--cta-fg, #fff) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px var(--cta-shadow, rgba(109, 85, 53, .45));
}
.nav-cta:focus-visible { outline: 2px solid var(--cta-bg, #826842); outline-offset: 3px; }
@media (max-width: 1100px) {
  .nav-cta { margin-right: 10px; padding: 8px 15px; font-size: .8rem; }
}
@media (max-width: 380px) {
  .nav-cta { padding: 7px 12px; letter-spacing: .03em; }
  .nav-cta svg { display: none; }
}

/* ---------- Page transition: the joining hands ----------
   Only between HHSH Home, Scholarship and Museum.
   Leaving:  parchment fades in; the gold hand slides in from the left and the
             black hand from the right; they meet, clasp (a small pulse), then
             the next page opens.
   Arriving: the clasped hands and the parchment slide down together,
             revealing the page, once its main photo is ready. */
.page-veil {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 60% at 50% 46%, rgba(255, 252, 244, .95), rgba(245, 240, 225, 0) 70%),
    #efe8d6;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
}
.veil-hands { --hs: clamp(140px, 22vw, 190px); position: relative; width: var(--hs); height: var(--hs); }
/* the clasped logo (gold + black layers); shown when the hands have met, and while the next page loads */
.veil-hands .clasp { position: absolute; inset: 0; z-index: 1; }
.veil-hands .hand { position: absolute; inset: 0; width: 100%; height: 100%; }
.veil-hands .hand-black { z-index: 2; }
/* the two complete hands that slide in (hidden unless the page is being left) */
.veil-hands .hf {
  position: absolute; z-index: 3;
  width: var(--hs); height: auto; aspect-ratio: 352 / 200;
  top: 50%; margin-top: calc(var(--hs) * -.284);
  max-width: none; opacity: 0; will-change: transform, opacity; pointer-events: none;
}
.veil-hands .hf-gold  { left: calc(var(--hs) * -.393); transform: rotate(14deg); }
.veil-hands .hf-black { left: calc(var(--hs) * .39); transform: rotate(-14deg); }
.veil-hands::after {             /* soft glow when the hands clasp */
  content: '';
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 94, .45), rgba(212, 175, 94, 0) 65%);
  opacity: 0;
  z-index: 0;
}

/* Leaving: a short loading screen. The clasped-hands logo pops in on parchment,
   then the next page opens about 0.3s later. (The sliding complete hands,
   .hf, are no longer used.) */
.veil-hands .hf { display: none; }
.page-veil.is-leaving { visibility: visible; pointer-events: auto; animation: veilIn .2s ease-out both; }
.page-veil.is-leaving .clasp { animation: claspPop .34s cubic-bezier(.34, 1.56, .64, 1) both; }
.page-veil.is-leaving .veil-hands::after { animation: clasGlow .6s ease-out .1s both; }

/* Arriving: start clasped and covered... */
html.veil-arrive .page-veil { opacity: 1; visibility: visible; pointer-events: auto; }
/* ...then everything slides down to reveal the page */
html.veil-arrive.veil-leave .page-veil { animation: veilOut .38s ease-out both; }
html.veil-arrive.veil-leave .veil-hands { animation: handsOut .38s ease-out both; }

/* Cover the page in the same colour (with the clasped hands) until site.js runs */
html.veil-arrive body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: url('/hand-black.png') center / clamp(140px, 22vw, 190px) clamp(140px, 22vw, 190px) no-repeat,
              url('/hand-gold.png') center / clamp(140px, 22vw, 190px) clamp(140px, 22vw, 190px) no-repeat,
              #efe8d6;
}
html.veil-arrive.veil-ready body::before { display: none; }

@keyframes veilIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes hfFromLeft  { 0% { opacity: 1; transform: translateX(-72vw) rotate(-8deg); } 70% { opacity: 1; transform: translateX(3%) rotate(17deg); } 100% { opacity: 1; transform: rotate(14deg); } }
@keyframes hfFromRight { 0% { opacity: 1; transform: translateX(72vw) rotate(8deg); } 70% { opacity: 1; transform: translateX(-3%) rotate(-17deg); } 100% { opacity: 1; transform: rotate(-14deg); } }
@keyframes hfOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes claspIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes claspPop { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes veilOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes handsOut { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes handsClasp { 0% { transform: scale(1); } 45% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes clasGlow { 0% { opacity: 0; transform: scale(.6); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes veilDown { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes handsDown { from { transform: translateY(0) scale(1); } to { transform: translateY(18vh) scale(.88); } }

/* ---------- Scroll animations follow your scrolling speed ----------
   site.js sets --reveal-dur: about 0.8s when you scroll slowly, down to
   about 0.25s when you fling the page. */
.fade-in, .slide-in-left, .slide-in-right {
  transition-duration: var(--reveal-dur, .8s) !important;
  transition-timing-function: cubic-bezier(.22, 1, .36, 1) !important;
}

/* ---------- "Email address copied" note ---------- */
.site-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100001;
  max-width: min(92vw, 460px);
  padding: 13px 20px;
  border-radius: 10px;
  background: #2c2416;
  color: #faf7f0;
  font: 500 .92rem/1.45 'Lora', Georgia, serif;
  text-align: center;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .3);
  transform: translate(-50%, 16px);
  opacity: 0;
  transition: opacity .3s, transform .4s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
.site-toast.show { opacity: 1; transform: translate(-50%, 0); }
.site-toast strong { color: #e0c27c; font-weight: 600; }

/* ---------- Readability (WCAG AA) ---------- */
.site-footer .footer-bottom p { opacity: .8; }               /* copyright line was too faint */
.team-section-card p a, .team-prose p a { text-decoration: underline; text-underline-offset: 3px; }
.footer-brand h2.footer-title { color: var(--accent-gold); margin-bottom: 6px; font-size: 1.3rem; }
