/* ---------- fonts (self-hosted) ---------- */
@font-face { font-family: "Lalezar"; font-weight: 400; font-display: swap; src: url(../assets/fonts/lalezar-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Lalezar"; font-weight: 400; font-display: swap; src: url(../assets/fonts/lalezar-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Vazirmatn"; font-weight: 400; font-display: swap; src: url(../assets/fonts/vazirmatn-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Vazirmatn"; font-weight: 600; font-display: swap; src: url(../assets/fonts/vazirmatn-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Vazirmatn"; font-weight: 800; font-display: swap; src: url(../assets/fonts/vazirmatn-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Vazirmatn"; font-weight: 400; font-display: swap; src: url(../assets/fonts/vazirmatn-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Vazirmatn"; font-weight: 600; font-display: swap; src: url(../assets/fonts/vazirmatn-arabic-600-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Vazirmatn"; font-weight: 800; font-display: swap; src: url(../assets/fonts/vazirmatn-arabic-800-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC; }

/* ---------- tokens ---------- */
:root {
  --ground: #111316;
  --soil: #08090b;
  --accent: #d42a2a;
  --bone: #ece5d6;
  --accent-ink: #ff6b5b;
  --accent-hot: #e53a30;
  --accent-deep: #7d1010;
  --bone-dim: #cfc6b6;
  --mute: #a79f92;
  --s1: #181b20;
  --s2: #20242a;
  --line: rgb(236 229 214 / 0.1);
  --line-strong: rgb(236 229 214 / 0.18);
  --wood-1: #5c4130;
  --wood-2: #2a1c13;
  --engrave: #16181b;
  --engrave-red: #5a0b0b;
  --display: "Lalezar", "Vazirmatn", system-ui, sans-serif;
  --body: "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --col: 480px;
  --gutter: 16px;
  --radius: 14px;
  color-scheme: dark;
  scrollbar-color: #3a3f47 var(--ground);
  scrollbar-width: thin;
  accent-color: var(--accent);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
html:focus-within { scroll-behavior: smooth; }
body, h1, h2, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--bone);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.8;
  caret-color: var(--accent);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
:lang(en) body, html[lang="en"] body { line-height: 1.6; }

::selection { background: var(--accent); color: var(--bone); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: #3a3f47; border-radius: 10px; border: 2px solid var(--ground); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

a { color: inherit; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 6px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- backdrop ---------- */

.cover {
  position: relative;
  height: 132px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 35%, transparent);
  mask-image: linear-gradient(#000 35%, transparent);
}
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; filter: brightness(0.85); }

.yard { display: none; }

/* ---------- column ---------- */
.col {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--col);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgb(8 9 11 / 0.72);
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.lang-toggle:hover { border-color: var(--accent-ink); color: #fff; }
.lang-top { position: absolute; top: max(12px, env(safe-area-inset-top)); inset-inline-end: 12px; z-index: 5; }

/* ---------- 1. who ---------- */
/* Identity row: horned avatar at inline-start, name + full bio beside it, overlapping the cover's lower edge. */
.who {
  display: grid;
  grid-template-columns: 88px 1fr;
  grid-template-areas: "av name" "av bio";
  grid-template-rows: auto 1fr;
  column-gap: 14px;
  align-items: start;
  margin-top: -50px;
  text-align: start;
}
.avatar { grid-area: av; position: relative; width: 88px; height: 88px; margin-top: 24px; }
.avatar img {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover;
  background: var(--s2);
  box-shadow: 0 10px 20px -8px rgb(0 0 0 / 0.8);
}
.horns { position: absolute; z-index: 0; width: 116px; left: 50%; top: -23px; translate: -50% 0; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.6)); }
.name {
  grid-area: name;
  margin-top: 18px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgb(0 0 0 / 0.7);
  text-wrap: balance;
}
.bio {
  grid-area: bio;
  margin-top: 4px;
  max-width: 60ch;
  color: var(--bone-dim);
  font-size: 0.875rem;
  line-height: 1.8;
  text-wrap: pretty;
}

/* ---------- buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: var(--bone);
  box-shadow: 0 12px 22px -10px rgb(0 0 0 / 0.85), inset 0 1px 0 rgb(255 255 255 / 0.18);
}
.btn-primary:hover { background: var(--accent-hot); }
.btn-primary .icon { fill: currentColor; stroke: none; }
.btn-big { min-height: 58px; font-size: 1.0625rem; }
.btn-ghost { background: var(--s1); border: 1px solid var(--line); color: var(--bone); font-weight: 600; }
.btn-ghost .icon { color: var(--accent-ink); }
.btn-ghost:hover { border-color: rgb(255 107 91 / 0.55); background: var(--s2); }
.btn-soon { position: relative; cursor: default; color: var(--mute); background: transparent; border: 1px dashed var(--line-strong); white-space: nowrap; }
.btn-soon .icon { color: var(--mute); }
.btn-soon:hover { background: transparent; border-color: var(--line-strong); }
.btn-soon:active { transform: none; }
.soon-tag {
  position: absolute;
  top: -10px;
  inset-inline-end: 10px;
  padding: 0 8px;
  border: 1px solid rgb(255 107 91 / 0.4);
  border-radius: 999px;
  background: #24120f;
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
}

/* ---------- 2. donate ---------- */
.donate { margin-top: 18px; display: grid; }
.heart { margin-inline: -8px; }
.heart img { width: 100%; height: auto; aspect-ratio: 800 / 487; object-fit: contain; }
/* panel-donate.webp alpha bbox is rows 3..484 of 487; the soil mound starts near row 395 (81%).
   Overlap = (487 - 395) / 487 of the art height = 0.115 x art width, so the button's top edge lands on
   the mound's upper edge and visibly covers its base at every width (percent margins follow width). */
.donate .btn-primary { position: relative; z-index: 1; margin: -12% 20px 0; }
.heart[hidden] + .btn-primary { margin-top: 0; }
.donate-more { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.donate-more > :last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- section headings ---------- */
.goal, .platforms, .gifts, .supporters { margin-top: 56px; }
.h {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 3;
  margin-bottom: 18px;
  text-wrap: balance;
}

/* ---------- 3. goal coffin ---------- */
.goal-body { display: grid; grid-template-columns: 1fr clamp(118px, 38vw, 156px); gap: 20px; align-items: center; }
.goal-info { display: grid; gap: 10px; }
.goal-h { margin-bottom: 0; }
.coffin-wrap { filter: drop-shadow(0 16px 18px rgb(0 0 0 / 0.7)); }
.coffin {
  --p: 0;
  --shape: polygon(30% 0, 70% 0, 100% 22%, 82% 100%, 18% 100%, 0 22%);
  position: relative;
  aspect-ratio: 156 / 232;
  clip-path: var(--shape);
  background: linear-gradient(160deg, var(--wood-1), var(--wood-2) 70%);
}
.coffin-in {
  position: absolute;
  inset: 7px;
  clip-path: var(--shape);
  background: radial-gradient(80% 60% at 50% 20%, #1c1414, var(--soil));
  overflow: hidden;
}
.liquid {
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--accent-hot), var(--accent-deep));
  transform: translateY(calc((100 - var(--p)) * 1%));
  transition: transform 2.4s var(--ease-out);
}
.liquid::before, .liquid::after {
  content: "";
  position: absolute;
  inset: -9px -40px auto;
  height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 10'%3E%3Cpath d='M0 6Q10 0 20 6T40 6V10H0z' fill='%23e53a30'/%3E%3C/svg%3E") repeat-x 0 0 / 40px 10px;
  animation: wave 3.2s linear infinite;
}
.liquid::after { opacity: 0.45; top: -7px; animation-duration: 4.6s; animation-direction: reverse; }
@keyframes wave { to { transform: translateX(40px); } }
.coffin-cross { position: absolute; width: 34%; left: 33%; top: 14%; fill: none; stroke: var(--bone); stroke-opacity: 0.16; stroke-width: 3; stroke-linecap: round; }
.pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 18%;
  font-family: var(--display);
  font-size: clamp(2rem, 9vw, 2.5rem);
  line-height: 1;
  text-shadow: 0 2px 8px rgb(0 0 0 / 0.85);
}
.goal-title { font-family: var(--display); font-size: 1.625rem; line-height: 1.35; color: var(--accent-ink); text-wrap: balance; }
.goal-amt { margin-top: -2px; color: var(--mute); font-size: 0.9375rem; text-wrap: balance; }

/* ---------- 4. platforms ---------- */
.graves { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; }
.graves .wide { grid-column: 1 / -1; }
.grave {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 0 0 6px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--bone);
  font-weight: 600;
  font-size: 0.9375rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.grave img { width: 100%; height: auto; aspect-ratio: 666 / 363; object-fit: contain; transition: transform 0.35s var(--ease-out); }
.grave-label { transition: color 0.2s; }
.grave-copy {
  flex-direction: row;
  gap: 12px;
  padding: 10px;
  background: linear-gradient(var(--s1), rgb(24 27 32 / 0.2));
  border: 1px solid var(--line);
  text-align: start;
}
.grave-copy img { width: 56%; aspect-ratio: 800 / 446; }
.grave-info { display: grid; gap: 4px; justify-items: start; }
.grave-info .grave-label { font-family: var(--display); font-weight: 400; font-size: 1.375rem; line-height: 1.2; }
.grave-addr { font-weight: 800; font-size: 1rem; color: var(--bone); unicode-bidi: isolate; }
.grave-hint { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-ink); font-size: 0.8125rem; font-weight: 600; }
.grave-hint .icon { width: 1.1em; height: 1.1em; }
@media (hover: hover) {
  .grave:hover img { transform: translateY(-4px); }
  .grave:hover .grave-label { color: #fff; }
  .grave-copy:hover { border-color: rgb(255 107 91 / 0.45); }
}

/* ---------- 5. gift guide: small tombstone cards ---------- */
.gifts-hint { margin: -10px 0 16px; color: var(--mute); font-size: 0.875rem; text-wrap: pretty; }
.gift-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.gift {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  height: 100%;
  padding: 14px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 50% 50% 12px 12px / 38px 38px 12px 12px;
  background:
    radial-gradient(90% 50% at 50% 0%, rgb(236 229 214 / 0.07), transparent 70%),
    linear-gradient(#1e2227, #15171b 70%, #0f1013);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06), 0 10px 16px -10px #000;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), border-color 0.2s, box-shadow 0.2s;
}
.gift-media { flex: none; display: grid; place-items: center; width: 78%; height: auto; aspect-ratio: 1; margin-bottom: 6px; }
.gift-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(closest-side, #000 78%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 78%, transparent 100%);
}
.gift-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--soil);
  color: var(--mute);
}
.gift-fallback .icon { width: 40px; height: 40px; stroke-width: 1.6; }
.gift-name { font-weight: 800; font-size: 0.875rem; line-height: 1.35; color: var(--bone); text-wrap: balance; }
.gift-amt { margin-top: auto; padding-top: 2px; font-weight: 600; font-size: 0.8125rem; color: var(--accent-ink); white-space: nowrap; }
.gift-check {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  display: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bone);
}
.gift-check .icon { width: 14px; height: 14px; stroke-width: 3; }
.gift:active { transform: scale(0.97); }
.gift[aria-pressed="true"] {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 0;
  box-shadow: 0 12px 20px -8px #000;
  background:
    radial-gradient(90% 60% at 50% 0%, rgb(212 42 42 / 0.2), transparent 70%),
    linear-gradient(#22191b, #161314 70%, #0f1013);
}
.gift[aria-pressed="true"] .gift-check { display: grid; }
@media (hover: hover) {
  .gift:hover { transform: translateY(-3px); border-color: rgb(255 107 91 / 0.45); }
}

.pay {
  position: sticky;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 4;
  margin-top: 16px;
}
.pay .btn {
  animation: rise 0.45s var(--ease-out);
  box-shadow: 0 14px 30px -8px rgb(0 0 0 / 0.9);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- 6. supporters tombstone ---------- */
.supporters { padding-bottom: 20px; }
.stone {
  position: relative;
  max-width: 400px;
  margin-inline: auto;
  margin-top: 40px;
  padding: 58px 24px 48px;
  text-align: center;
  color: var(--engrave);
  border-radius: 50% 50% 0 0 / 30% 30% 0 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .28 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(70% 40% at 30% 12%, rgb(255 255 255 / 0.22), transparent 70%),
    radial-gradient(40% 30% at 85% 80%, rgb(0 0 0 / 0.14), transparent 70%),
    linear-gradient(#c2c1bb, #a5a6a4 45%, #929394);
  box-shadow: inset 0 3px 0 rgb(255 255 255 / 0.28), inset 0 -16px 28px rgb(0 0 0 / 0.28), 0 28px 40px -20px #000;
}
.stone::after {
  content: "";
  position: absolute;
  inset: auto -4% -20px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(#3a2a1e, #1c130c 70%);
  z-index: 1;
}
.stone-horns { position: absolute; left: 50%; top: -34px; width: 78%; translate: -50% 0; z-index: -1; filter: drop-shadow(0 6px 8px rgb(0 0 0 / 0.6)); }
.stone-cracks { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: rgb(22 24 27 / 0.45); stroke-width: 1.6; stroke-linejoin: round; pointer-events: none; filter: drop-shadow(0 1px 0 rgb(255 255 255 / 0.35)); }
.stone-skull { width: 64px; margin: 0 auto 6px; fill: none; stroke: var(--engrave); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 0 rgb(255 255 255 / 0.45)); }
.stone-skull .skull { fill: rgb(22 24 27 / 0.12); }
.stone-skull .eye { fill: var(--engrave-red); stroke: none; }
.stone-h {
  position: relative;
  font-family: var(--display);
  font-weight: 400;
  font-size: 2.25rem;
  line-height: 1.2;
  color: var(--engrave-red);
  text-shadow: 0 1px 0 rgb(255 255 255 / 0.4), 0 -1px 0 rgb(0 0 0 / 0.35);
  text-wrap: balance;
}
.stone-period { margin-top: 2px; font-weight: 600; font-size: 0.875rem; color: #26282b; text-shadow: 0 1px 0 rgb(255 255 255 / 0.35); }
.stone-list { display: grid; gap: 10px; margin-top: 22px; }
.stone-row {
  display: grid;
  grid-template-columns: 2ch 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgb(22 24 27 / 0.18);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.25);
  text-align: start;
}
.stone-row:last-child { border-bottom: 0; box-shadow: none; padding-bottom: 0; }
.stone-rank, .stone-name {
  font-family: var(--display);
  color: var(--engrave-red);
  text-shadow: 0 1px 0 rgb(255 255 255 / 0.4), 0 -1px 0 rgb(0 0 0 / 0.35);
}
.stone-rank { font-size: 1.5rem; line-height: 1; color: var(--engrave); }
.stone-name { font-size: 1.5rem; line-height: 1.25; overflow-wrap: anywhere; text-align:right; }
.stone-row.rank-1 {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
  padding: 4px 0 14px;
  text-align: center;
}
.stone-crown { width: 58px; height: 29px; color: var(--accent); filter: drop-shadow(0 1px 0 rgb(255 255 255 / 0.4)); }
.icon-fill { fill: currentColor; stroke: none; }
.rank-1 .stone-name { font-size: 2.5rem; line-height: 1.15; }
.rank-1 .stone-amt { font-size: 1rem; }
.stone-amt { font-weight: 800; font-size: 0.9375rem; color: var(--engrave); white-space: nowrap; text-shadow: 0 1px 0 rgb(255 255 255 / 0.3); }

/* ---------- 7. footer ---------- */
.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 64px;
  padding: 24px 0 calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 0.875rem;
}
.foot-domain { color: var(--mute); text-decoration: none; direction: ltr; unicode-bidi: isolate; }
.foot-domain[href]:hover { color: var(--bone); text-decoration: underline; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 10;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 16px;
  border: 1px solid rgb(255 107 91 / 0.5);
  border-radius: 12px;
  background: #1b1e23;
  color: var(--bone);
  font-weight: 600;
  font-size: 0.9375rem;
  text-align: center;
  box-shadow: 0 6px 10px -6px #000;
  opacity: 0;
  translate: -50% 12px;
  pointer-events: none;
  transition: opacity 0.25s, translate 0.35s var(--ease-out);
}
.toast.show { opacity: 1; translate: -50% 0; }
.toast:empty { display: none; }

/* ---------- no-JS ---------- */
.nojs { display: grid; gap: 12px; max-width: 420px; margin: 40px auto; padding: 0 16px; text-align: center; }
.nojs-name { font-family: var(--display); font-size: 2rem; }
.nojs a { padding: 14px; border-radius: var(--radius); background: var(--accent); color: var(--bone); font-weight: 800; text-decoration: none; }

/* ---------- small phones ---------- */
@media (max-width: 350px) {
  :root { --gutter: 12px; }
  .goal-body { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .goal-info { justify-items: center; }
  .coffin-wrap { width: 140px; }
  .who { grid-template-columns: 72px 1fr; grid-template-areas: "av name" "bio bio"; grid-template-rows: auto auto; column-gap: 12px; }
  .avatar, .avatar img { width: 72px; height: 72px; }
  .horns { width: 96px; top: -19px; }
  .name { margin-top: 18px; font-size: 1.75rem; }
  .bio { margin-top: 10px; }
  .grave-copy { flex-direction: column; text-align: center; }
  .grave-copy img { width: 100%; }
  .grave-info { justify-items: center; }
  .stone { padding-inline: 16px; }
  .gift-grid { gap: 10px 8px; }
  .donate-more .btn { gap: 8px; padding-inline: 10px; white-space: nowrap; }
  .gift-name { font-size: 0.8125rem; }
}

/* ---------- desktop backdrop ---------- */
@media (min-width: 900px) {
  .cover { height: clamp(150px, 13vw, 210px); }
  .yard {
    display: block;
    position: fixed;
    bottom: 0;
    width: calc((100vw - var(--col)) / 2 - 24px);
    max-width: 640px;
    height: min(34vh, 320px);
    pointer-events: none;
    z-index: 0;
  }
  .yard { background: radial-gradient(60% 55% at 50% 78%, rgb(140 22 22 / 0.3), transparent 72%); }
  .yard svg { width: 100%; height: 100%; fill: var(--soil); }
  .yard .yard-branch { fill: none; stroke: var(--soil); stroke-width: 7; stroke-linecap: round; }
  .yard .yard-moon { fill: var(--bone); opacity: 0.07; }
  .yard-start { inset-inline-start: 0; }
  .yard-end { inset-inline-end: 0; }
  [dir="rtl"] .yard-start svg, [dir="rtl"] .yard-end svg { transform: scaleX(-1); }
  .lang-top { top: 18px; inset-inline-end: 24px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* User-supplied text (goal title, donor names) keeps its own bidi direction but aligns with the page. */
[dir="rtl"] .goal-title { text-align: right; }
[dir="ltr"] .goal-title { text-align: left; }
@media (max-width: 350px) { [dir] .goal-title { text-align: center; } }
