/* Zag Store — Contribute
   Built on tokens.css, main.css and pages.css. One beam enters the Z and
   leaves as five colours, one per provider; each provider "lens" carries its
   colour as light, never as a filled card. Logos are official files shown
   unaltered (black or white per appearance, as their guidelines ask).
   Motion is CSS plus a tiny reveal module; nothing is required to read. */

/* Provider light. Brand colours are external identities, so they live here
   rather than in the Zag Store tokens. --pv: the light, --pv2: a second
   colour from the same brand palette for the corner glow, --pv-on: the icon
   colour on --pv. Ko-fi: current palette #ff6433 / #c19bff / #72a5f2. */
.lens--paypal { --pv: #0070e0; --pv-on: #fff; }
.lens--stripe { --pv: #635bff; --pv-on: #fff; }
.lens--github { --pv: #bf3989; --pv-on: #fff; }
.lens--kofi { --pv: #ff6433; --pv2: #c19bff; --pv-on: #fff; }
.lens--bmc { --pv: #ffdd00; --pv-on: #0d0c22; }
:root[data-theme="dark"] .lens--paypal { --pv: #2f8fff; }
:root[data-theme="dark"] .lens--stripe { --pv: #7a73ff; }
:root[data-theme="dark"] .lens--github { --pv: #db61a2; }
:root[data-theme="dark"] .lens--kofi { --pv2: #72a5f2; }
.ray-stop--paypal { stop-color: #0070e0; }
.ray-stop--stripe { stop-color: #635bff; }
.ray-stop--github { stop-color: #db61a2; }
.ray-stop--kofi { stop-color: #ff6433; }
.ray-stop--bmc { stop-color: #ffdd00; }

/* Hero: copy on the left, the prism on the right ---------------------------- */
.give-hero__inner.wrap {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}
.give-hero__copy { display: grid; justify-items: start; }
.give-hero__title { max-width: 11ch; }
.give-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 28px;
  padding: 0;
  list-style: none;
  color: var(--text-secondary);
  font-size: 14px;
}
.give-facts li { display: inline-flex; align-items: center; gap: 8px; }
.give-facts__icon { width: 16px; height: 16px; color: var(--accent-text); }
.give-hero .cta-row { margin-top: 36px; }

.prism {
  position: relative;
  justify-self: center;
  width: min(100%, 440px);
  aspect-ratio: 44 / 50;
  pointer-events: none;
}
.prism__beam {
  position: absolute;
  left: 50%;
  top: -24%;
  width: 1px;
  height: 44%;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--text-primary) 55%, transparent));
}
.prism__ring {
  position: absolute;
  left: 8%;
  top: -1%;
  width: 84%;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 1px;
  background: conic-gradient(from 200deg, var(--zag-cyan-500), transparent 22%, var(--zag-blue-500) 42%, transparent 58%, var(--zag-magenta-500) 78%, var(--zag-cyan-500));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: var(--stage-ring-opacity);
}
.prism__z {
  position: absolute;
  left: 27%;
  top: 14%;
  width: 46%;
  aspect-ratio: 1236 / 1272;
}
.prism__z .z-light { --glow-pad: 100px; }
.prism__z picture, .prism__z-img { position: relative; display: block; width: 100%; height: 100%; }
.prism__fan {
  position: absolute;
  left: 0;
  top: 58%;
  width: 100%;
  height: 42%;
  overflow: visible;
}
.prism__ray {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* Sections ------------------------------------------------------------------ */
.give-section { margin-top: clamp(88px, 11vw, 168px); scroll-margin-top: calc(var(--header-h) + 24px); }
.give-head { display: grid; gap: 18px; max-width: 760px; margin-bottom: clamp(32px, 4.5vw, 60px); }
.give-head__title { font-size: clamp(2.1rem, 4.6vw, 4rem); }

/* Provider lenses ----------------------------------------------------------- */
.lenses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 22px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.lens-slot { display: flex; }
.lens-slot--feature { grid-column: 1 / -1; }

.lens {
  --mx: 85%;
  --my: 0%;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr;
  gap: 14px;
  width: 100%;
  min-height: 300px;
  padding: clamp(24px, 3vw, 40px);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--elevation-1);
  color: var(--text-primary);
  text-decoration: none;
  transition:
    transform 700ms var(--ease-out-expo),
    border-color 400ms var(--ease-out-quart),
    box-shadow 700ms var(--ease-out-expo);
}
/* The provider's colour enters along the top edge, like light through glass. */
.lens::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent 8%, var(--pv) 50%, transparent 92%);
  opacity: 0.85;
}
.lens__light {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 90% at var(--mx) var(--my), color-mix(in srgb, var(--pv) 22%, transparent), transparent 70%),
    radial-gradient(40% 50% at 100% 0%, color-mix(in srgb, var(--pv2, var(--pv)) 14%, transparent), transparent 75%);
  opacity: 0.7;
  transition: opacity 600ms var(--ease-out-quart);
}
.lens__logo { display: flex; align-items: center; min-height: 44px; margin-bottom: 10px; }
.lens__logo-img { display: block; width: auto; }
.lens--paypal .lens__logo-img { height: 30px; }
.lens--stripe .lens__logo-img { height: 40px; margin-block: -5px; } /* the file's own clear space */
.lens--github .lens__logo-img { height: 30px; }
.lens--kofi .lens__logo-img { height: 32px; }
/* Ko-fi's kit has no logo for dark backgrounds: show it unaltered on a
   light plate, its intended ground, rather than recolouring it. */
:root[data-theme="dark"] .lens__logo-img--plate {
  box-sizing: content-box;
  padding: 9px 14px;
  border-radius: 12px;
  background: #fff;
}
:root[data-theme="dark"] .lens--kofi .lens__logo-img { height: 26px; margin-left: -14px; } /* plate fills the 44px logo row */
.lens__badge { display: block; width: 40px; height: 40px; margin-right: 14px; border-radius: 10px; }
.lens__logo-img[data-logo="dark"] { display: none; }
:root[data-theme="dark"] .lens__logo-img[data-logo="light"] { display: none; }
:root[data-theme="dark"] .lens__logo-img[data-logo="dark"] { display: block; }
.lens__wordmark {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.035em;
}
.lens__kicker {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-feature-settings: "case" 1;
}
.lens__text { max-width: 46ch; color: var(--text-secondary); font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.lens__foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
  align-self: end;
}
.lens__action {
  flex: 1;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-feature-settings: "case" 1;
}
.lens__host { color: var(--text-tertiary); font-family: var(--font-mono); font-size: 12px; }
.lens__go {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--text-primary);
  transition: background-color 400ms var(--ease-out-quart), box-shadow 400ms var(--ease-out-quart), color 250ms linear;
}
.lens__go-icon { width: 17px; height: 17px; transition: transform 600ms var(--ease-out-expo); }

/* PayPal leads, full width, with its monogram as the lens's anchor. */
.lens--paypal { grid-template-columns: minmax(0, 1fr) auto; column-gap: clamp(24px, 5vw, 72px); min-height: 0; }
.lens--paypal .lens__logo, .lens--paypal .lens__kicker, .lens--paypal .lens__text { grid-column: 1; }
.lens--paypal .lens__foot { grid-column: 1 / -1; }
.lens__mark { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: clamp(64px, 8vw, 104px); }
.lens__mark img { display: block; width: 100%; height: auto; }

@media (hover: hover) {
  .lens:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--pv) 45%, var(--border-subtle));
    box-shadow: var(--elevation-2), 0 24px 60px -30px color-mix(in srgb, var(--pv) 70%, transparent);
  }
  .lens:hover .lens__light { opacity: 1; }
  .lens:hover .lens__go { background: var(--pv); box-shadow: inset 0 0 0 1px var(--pv); color: var(--pv-on); }
  .lens:hover .lens__go-icon { transform: translate(2px, -2px); }
}
.lens:active { transform: translateY(-1px) scale(0.995); transition-duration: 150ms; }
.lens:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 4px; }
.lens:focus-visible .lens__light { opacity: 1; }

/* Impact: one spectrum, split across four bands ----------------------------- */
.bands {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 36px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.band { position: relative; display: grid; align-content: start; gap: 12px; padding-top: 26px; }
.band::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  border-radius: 2px;
  background: var(--spectrum-brand);
  background-size: 400% 100%;
  background-position: calc(var(--i) * 33.333%) 0;
}
.band__num { color: var(--text-tertiary); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; }
.band__title { font-size: clamp(1.2rem, 1.7vw, 1.45rem); font-weight: 700; letter-spacing: -0.03em; }
.band__text { color: var(--text-secondary); line-height: 1.6; text-wrap: pretty; }

/* Promise ------------------------------------------------------------------- */
.promise {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 80px);
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--elevation-1);
}
.promise__head { display: grid; gap: 18px; align-content: start; }
.promise__list { display: grid; gap: 26px; margin: 0; padding: 0; list-style: none; }
.promise__list li { display: grid; grid-template-columns: auto 1fr; gap: 16px; }
.promise__list h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.promise__list p { margin-top: 6px; color: var(--text-secondary); line-height: 1.6; }
.promise__icon {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--accent-text);
}
.promise__legal { grid-column: 1 / -1; max-width: 90ch; padding-top: 24px; border-top: 1px solid var(--border-subtle); }

/* Close --------------------------------------------------------------------- */
.give-close { display: grid; justify-items: center; gap: 18px; text-align: center; }
.give-close .give-head__title { max-width: 18ch; }
.give-close .body-lg { max-width: 54ch; }
.give-close .cta-row { justify-content: center; margin-top: 18px; }

/* Motion -------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .prism__beam { animation: fade-in 2.2s ease 0.1s backwards; }
  .prism__ring { animation: aperture-open 2.2s var(--ease-out-expo) 0.2s backwards; }
  .prism__z-img { animation: z-rise 1.6s var(--ease-out-expo) 0.3s backwards; }
  .prism__z .z-light { animation: fade-in 1.4s var(--ease-out-quart) 0.8s backwards; }
  .prism__ray { stroke-dasharray: 1; animation: ray-draw 1.4s var(--ease-out-expo) calc(1s + var(--i) * 90ms) backwards; }

  /* Reveals only once the module has marked the page, so content never
     depends on JavaScript to appear. */
  .reveal-ready [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 900ms var(--ease-out-quart), transform 1200ms var(--ease-out-expo);
    transition-delay: var(--d, 0ms);
  }
  .reveal-ready [data-reveal].is-in { opacity: 1; transform: none; }
}
@keyframes ray-draw { from { stroke-dashoffset: 1; } }
@media (prefers-reduced-motion: reduce) {
  .lens, .lens__light, .lens__go, .lens__go-icon { transition: none; }
  .lens:hover, .lens:active { transform: none; }
}
@media (forced-colors: active) {
  .lens { border-color: CanvasText; }
  .lens__light, .lens::before { display: none; }
}

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 999px) {
  .give-hero__inner.wrap { grid-template-columns: 1fr; }
  .prism { order: -1; width: min(70%, 300px); margin-bottom: -12px; }
  .bands { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .promise { grid-template-columns: 1fr; }
}
@media (max-width: 699px) {
  .lenses { grid-template-columns: 1fr; }
  .lens { min-height: 0; }
  .lens--paypal { grid-template-columns: minmax(0, 1fr) auto; }
  .lens__mark { grid-row: 1; align-self: start; width: 52px; }
  .lens--paypal .lens__kicker, .lens--paypal .lens__text { grid-column: 1 / -1; }
  .bands { grid-template-columns: 1fr; row-gap: 32px; }
}
@media (max-width: 419px) {
  .lens__host { display: none; }
}
