body:is([data-page="pyupi"], [data-page="donations-pyupi"]) #main {
  width: 100%;
  font-family: system-ui, sans-serif;
  color: var(--text);
  color-scheme: dark;
  scrollbar-gutter: stable;
  --background: #141016;
  --text: #fff4f8;
  --muted: #c2afc0;
  --accent: #ff9cc7;
  --line: #3c303d;
  --mono: "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

body:is([data-page="pyupi"], [data-page="donations-pyupi"]) {
  margin: 0;
  background: radial-gradient(ellipse at 22% 16%, #2e192b 0%, transparent 54%), #141016;
}

.page {
  --masthead-padding: 17px;
  width: min(100% - 64px, 1040px);
  min-height: 100vh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}

.profile {
  display: grid;
  grid-template-areas:
    "portrait directory"
    "identity support";
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-content: center;
  gap: 44px clamp(32px, 7vw, 88px);
  padding-block: clamp(44px, 8vh, 90px);
}

.directory { display: block; grid-area: directory; font-weight: normal; color: inherit; }

.portrait {
  grid-area: portrait;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: clamp(170px, 27vw, 256px);
  overflow: hidden;
  border: 1px solid #5f3a56;
  border-radius: 24px;
  background:
    repeating-linear-gradient(120deg, transparent 0 23px, #ff9cc70e 24px 25px),
    radial-gradient(ellipse at 55% 70%, #a14275, transparent 70%),
    linear-gradient(135deg, #271329, #492540 74%, #321b34);
}

.portrait::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 11px;
  border: 1px solid #ffb2d12b;
  border-radius: 16px;
}

.portrait-ring {
  position: absolute;
  z-index: -1;
  width: 58%;
  height: 46%;
  border: 1px solid #ffc4df90;
  border-radius: 50%;
  transform: rotate(-22deg);
  box-shadow: 0 0 36px #e58abb37, inset 0 0 26px #e58abb26;
}

.portrait-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 12px;
  object-fit: contain;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .portrait::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 50%;
    left: 50%;
    width: min(90%, 340px);
    aspect-ratio: 1;
    pointer-events: none;
    background: radial-gradient(circle, #ffb9dc70, #f478b436 35%, transparent 70%);
    opacity: 0;
    transform: translate3d(calc(var(--portrait-x, 0px) - 50%), calc(var(--portrait-y, 0px) - 50%), 0);
    transition: opacity .28s ease;
  }

  .portrait.is-reactive::before { opacity: 1; }
  .portrait-logo { transition: transform .28s ease-out; }

  .portrait.is-reactive .portrait-logo {
    transform: translate3d(calc(var(--portrait-x) * .045), calc(var(--portrait-y) * .075), 0) scale(1.11);
  }
}

.spark { position: absolute; color: #ffe2ef; }
.spark-large { top: 18%; right: 18%; font-size: clamp(20px, 4vw, 38px); }
.spark-small { bottom: 20%; left: 17%; font-size: 22px; }
.intro-copy { grid-area: identity; }

.eyebrow {
  margin: 0;
  color: var(--accent);
  font: 12px/1.4 var(--mono);
  letter-spacing: .17em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(64px, 10vw, 124px);
  font-weight: 800;
  line-height: .97;
  letter-spacing: -.09em;
}

h1 span { color: var(--accent); }
.intro-description {
  margin: 21px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.intro-copy .eyebrow,
.intro-description,
.feedback-intro {
  margin-inline-start: clamp(3px, .4vw, 5px);
}

h2 { margin: 5px 0 18px; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.055em; line-height: 1.1; }
.link-list { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }

.link-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #211a24;
  transition: background-color .18s ease, border-color .18s ease;
}

.link-destination {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 15px;
  border-radius: 13px;
  color: var(--text);
  text-decoration: none;
}

.directory .link-destination:hover { background: transparent; }

@media (hover: hover) {
  .link-card:hover { background: #2B2338; border-color: var(--accent); }
}

.link-destination:focus-visible, .copy-link:focus-visible, .link-copy-fallback:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.link-copy { display: grid; gap: 2px; }
.link-copy strong { font-size: 16px; }
.link-copy span { color: var(--muted); font-size: 13px; }
.link-icon { display: block; object-fit: contain; }

.copy-link:not([hidden]) {
  display: grid;
  place-items: center;
}

.copy-link {
  width: 44px;
  height: 44px;
  margin-inline-end: 10px;
  padding: 0;
  border: 1px solid #654656;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.copy-link:hover { border-color: var(--accent); }
.copy-link, #copy-address {
  transition: background-color .3s ease-out, border-color .3s ease-out, box-shadow .3s ease-out;
}

.copy-link.copy-confirmed, #copy-address.copy-confirmed { transition-duration: .1s; }
.copy-link.copy-confirmed { border-color: var(--accent); background: #65354f; box-shadow: 0 0 12px #ff9cc760; }
.link-copy-status { margin: 0; color: var(--accent); font-size: 13px; }
.link-copy-status:not(:empty):not(.copy-status-quiet) { margin-top: 8px; }

.copy-status-quiet {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .copy-confirmed { animation: copy-pop .28s ease-out; }
}

@keyframes copy-pop {
  45% { transform: scale(1.08); }
}

.link-copy-fallback {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid #70495e;
  border-radius: 10px;
  background: var(--background);
  color: var(--accent);
  font: 13px var(--mono);
}

.support {
  grid-area: support;
  align-self: center;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 12px 16px;
  border: 1px solid #ffd2e7;
  border-radius: 14px;
  background: linear-gradient(115deg, #ffe1ef, #fba7cd 72%, #f58abd);
  color: #301427;
  text-decoration: none;
  box-shadow: 0 0 24px #ff8db64a, 0 8px 26px #10091166;
  transition: box-shadow .18s ease;
}

.heart {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #752c5150;
  border-radius: 50%;
  font-size: 27px;
  line-height: 1;
}

.support-label { display: grid; gap: 2px; }
.support-label strong { font-size: 18px; }
.support-label span { color: #582343; font-size: 13px; }

@media (hover: hover) {
  .support:hover { box-shadow: 0 0 32px #ff8db685, 0 8px 26px #10091166; }
}

.support:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

body[data-page="pyupi"] { background-size: 100% 100svh; background-repeat: no-repeat; }
.home-nav { display: flex; align-items: center; gap: clamp(16px, 4vw, 36px); }
.profile { min-height: calc(100svh - 45px - 2 * var(--masthead-padding)); }

.feedback-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: start;
  gap: clamp(24px, 6vw, 72px);
  padding-block: clamp(40px, 8vw, 84px);
  border-top: 1px solid var(--line);
}

.feedback-section:focus { outline: none; }

.feedback-intro h2 {
  margin: 8px 0 12px;
  margin-inline-start: -.065em;
  font-size: clamp(36px, 6vw, 66px);
}
.feedback-intro h2 span { color: var(--accent); }
.feedback-intro p:last-child { margin: 0; color: var(--muted); line-height: 1.55; }

.feedback-form {
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid #75425f;
  border-radius: 20px;
  background: radial-gradient(ellipse at top right, #40243b, transparent 65%), #211a24;
}

.feedback-form fieldset { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.feedback-form label { font-weight: 600; }
.feedback-form label span { margin-left: 6px; color: var(--muted); font: 12px var(--mono); }

.feedback-form input, .feedback-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #70495e;
  border-radius: 10px;
  background: var(--background);
  color: var(--text);
  font: inherit;
}

.feedback-form input { margin-bottom: 8px; }
.feedback-form textarea { resize: vertical; }
.feedback-form textarea[aria-invalid="true"] { border-color: var(--accent); }
.feedback-message-error { margin: 0; color: var(--accent); font-size: .875rem; line-height: 1.5; }
.feedback-message-error:empty { position: absolute; }
.feedback-form button {
  justify-self: start;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #301427;
  font: 700 14px system-ui, sans-serif;
  cursor: pointer;
}

.feedback-form button:disabled { cursor: wait; opacity: .7; }
.feedback-form button:enabled:hover { background: #ffd2e7; }
.feedback-form :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#feedback-status { margin: 0; color: var(--accent); line-height: 1.5; }
#feedback-status:not(:empty) { margin-top: 12px; }

.feedback-toast {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #140b17a6;
  backdrop-filter: blur(7px);
  pointer-events: none;
  opacity: 0;
  transition: opacity .28s ease;
}

.feedback-toast p {
  margin: 0;
  color: var(--text);
  font-size: clamp(26px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.04em;
  text-align: center;
  text-shadow: 0 0 12px #ff9cc74d;
}

.feedback-toast.is-visible { opacity: 1; }

@keyframes feedback-pop {
  0% { transform: translateY(10px) scale(.72); }
  66% { transform: translateY(-2px) scale(1.07); }
  100% { transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: no-preference) {
  .feedback-enabled { scroll-behavior: smooth; }
  .feedback-toast.is-visible p { animation: feedback-pop .42s ease-out; }

  @supports (animation-timeline: view()) and (animation-range: exit 0% exit 85%) {
    .profile:not(:focus-within) {
      animation: profile-fade 1ms linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 85%;
    }
  }
}

@keyframes profile-fade {
  from { opacity: 1; }
  to { opacity: .35; }
}

@media (max-width: 700px) {
  .page { --masthead-padding: 10px; width: calc(100% - 36px); max-width: 480px; }
  .profile {
    grid-template-areas: "portrait" "identity" "directory" "support";
    grid-template-columns: minmax(0, 1fr);
    row-gap: 22px;
    padding-block: 26px 40px;
  }
  .support { margin-block-start: 22px; }
  .feedback-section { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .home-link, .link-card, .support, .feedback-toast { transition: none; }
  .copy-link, #copy-address, .copy-link.copy-confirmed, #copy-address.copy-confirmed { transition: none; }
}

.support-page {
  flex: 1;
  width: min(100%, 760px);
  margin-inline: auto;
  padding-block: clamp(36px, 8vh, 80px);
}

.support-intro { margin-bottom: 28px; }
.support-intro h1 { margin-top: 8px; font-size: clamp(42px, 8vw, 82px); letter-spacing: -.07em; }
.support-intro > p:last-child { margin: 14px 0 0; color: var(--muted); line-height: 1.5; }

.donation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(145px, 190px);
  gap: clamp(18px, 4vw, 32px);
  align-items: start;
  padding: clamp(16px, 4vw, 32px);
  border: 1px solid #75425f;
  border-radius: 24px;
  background: radial-gradient(ellipse at top right, #44253e, transparent 65%), #211a24;
  box-shadow: 0 0 36px #fa86bc22;
}

.payment-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.payment-details div { padding: 8px 12px; border: 1px solid #70495e; border-radius: 10px; }
.payment-details dt { color: var(--muted); font: 11px var(--mono); text-transform: uppercase; }
.payment-details dd { margin: 4px 0 0; font-weight: 650; }
.donation-details > p:last-child, .network-note { color: var(--muted); line-height: 1.55; }
.donation-details > p:last-child { margin: 16px 0 0; }
.donation-details strong, .network-note strong { color: var(--text); }

.donation-qr { width: min(100%, 190px); margin: 0; text-align: center; }
.donation-qr img { display: block; width: 100%; height: auto; border-radius: 12px; }
.donation-qr figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }

.address-panel { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--line); }
.address-panel label { display: block; margin-bottom: 8px; color: var(--accent); font: 12px var(--mono); }
.address-controls { display: flex; flex-wrap: wrap; gap: 8px; }

.address-controls input {
  flex: 1 1 24em;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #70495e;
  border-radius: 10px;
  background: var(--background);
  color: var(--text);
  font: 13px var(--mono);
}

.address-controls button {
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #301427;
  font: 700 14px system-ui, sans-serif;
  cursor: pointer;
}

.address-controls button:hover { background: #ffd2e7; }
.address-controls button.copy-confirmed { background: #fff0f7; box-shadow: 0 0 14px #ff9cc760; }
.address-controls :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#copy-status { margin: 0; color: var(--accent); font-size: 13px; }
#copy-status:not(:empty):not(.copy-status-quiet) { margin-top: 8px; }
.network-note { margin: 12px 0 0; font-size: 13px; }
.donation-message { margin: 18px 0 0; color: var(--muted); line-height: 1.5; }
.donation-message a { color: var(--accent); text-underline-offset: 3px; }
.donation-message a:hover { color: var(--text); }

@media (max-width: 540px) {
  .donation-card { grid-template-columns: minmax(0, 1fr); }
  .donation-qr { justify-self: center; }
  .address-controls input { flex-basis: 100%; }
  .address-controls button { width: 100%; }
}

.pyupi-donations-link { color: var(--accent); }
.pyupi-donations-link:is(:hover, :focus-visible) { text-decoration: underline; }
.support-intro { margin-top: 22px; }
.support-page .copy-status-quiet {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (min-width: 701px) {
  .profile .portrait { min-height: 324px; }
}
