:root {
  color-scheme: dark;
  --background: #0a0d12;
  --surface: #121820;
  --surface-raised: #18212b;
  --line: #293440;
  --text: #f1f5f9;
  --muted: #a9b6c5;
  --subtle: #8a9aab;
  --emerald: #10b981;
  --emerald-light: #6ee7b7;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 12% 3%, #10251e 0, transparent 42rem), var(--background);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 4px;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  min-height: 44px;
  color: inherit;
  cursor: pointer;
}

button:disabled,
a[aria-disabled="true"] {
  opacity: 0.55;
  cursor: default;
}

:focus-visible {
  outline: 2px solid var(--emerald-light);
  outline-offset: 4px;
}

::selection {
  background: #115740;
  color: #fff;
}

[hidden] {
  display: none !important;
}

.site-shell {
  width: min(1120px, calc(100% - 80px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 104px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.brand img {
  display: block;
  width: 42px;
  height: 42px;
  border: 1px solid #303e4a;
  border-radius: 10px;
}

.brand-name {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.07em;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--subtle);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  min-width: 0;
}

.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.repo-link svg,
.quick-links svg,
.qr-actions svg,
.copy-button svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10161d;
}

.language-switch button {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
}

.language-switch button[aria-pressed="true"],
.language-switch button[aria-current="true"],
.language-switch button.active {
  background: #26332f;
  color: var(--emerald-light);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 438px);
  align-items: start;
  column-gap: clamp(40px, 6vw, 100px);
  padding-block: 70px 64px;
}

.intro {
  min-width: 0;
  padding-top: 28px;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--emerald-light);
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.eyebrow span {
  display: inline-block;
}

h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(2.8rem, 4.8vw, 4.5rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1.12;
  text-wrap: balance;
}

h1 em,
h1 .accent,
h1 .accent-text {
  color: var(--emerald-light);
  font-style: normal;
}

.lead {
  max-width: 45ch;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.8;
  text-wrap: pretty;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.primary-link {
  background: var(--emerald);
  color: #041d15;
}

.secondary-link {
  border-color: var(--line);
  background: #131c21;
  color: #dae4e9;
}

.project-note {
  max-width: 44ch;
  margin-top: 20px;
  color: var(--subtle);
  font-size: 0.875rem;
}

.policy {
  max-width: 45ch;
  margin-top: 56px;
  padding: 2px 0 2px 20px;
  border-left: 2px solid #2c6651;
}

.policy h2 {
  margin: 0 0 10px;
  color: #dce9e2;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.policy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.8;
}

.policy p + p {
  margin-top: 12px;
}

.policy a {
  color: var(--emerald-light);
  text-decoration: underline;
}

.donation-panel {
  min-width: 0;
  padding: 28px;
  border: 1px solid #33433e;
  border-radius: 20px;
  background: linear-gradient(155deg, #18251f 0, #131b21 32%, #11171e 100%);
  box-shadow: 0 16px 60px #00000026;
}

.panel-heading {
  margin-bottom: 24px;
}

.panel-heading p {
  margin: 0 0 6px;
  color: var(--emerald-light);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.5;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.panel-heading .panel-description {
  margin-top: 10px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.voluntary-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 4px 9px;
  border: 1px solid #335543;
  border-radius: 6px;
  background: #193428;
  color: #a7e4c7;
  font-size: 0.8125rem;
  line-height: 1.5;
}

#donation-form {
  margin: 0;
}

#donation-form label,
#donation-form legend {
  display: block;
  margin: 0 0 10px;
  color: #c3cfdb;
  font-size: 0.875rem;
  font-weight: 500;
}

#donation-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.amount-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.amount-chip {
  min-width: 0;
  min-height: 44px;
  padding: 9px 6px;
  border: 1px solid #35424d;
  border-radius: 8px;
  background: #19222a;
  color: #cbd5df;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1.5;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.amount-chip[aria-pressed="true"] {
  border-color: var(--emerald);
  background: #143c2d;
  color: #a7f3d0;
}

.amount-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  border: 1px solid #40514f;
  border-radius: 10px;
  background: #0b1417;
}

.amount-field:focus-within {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px #10b9811a;
}

.amount-field input {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 11px 0 11px 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.amount-field input::placeholder {
  color: var(--subtle);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.875rem;
  opacity: 1;
}

.amount-field input[aria-invalid="true"] {
  color: #fca5a5;
}

.currency {
  flex: 0 0 auto;
  padding-right: 16px;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.875rem;
}

.amount-help {
  margin: 10px 0 0;
  color: var(--subtle);
  font-size: 0.875rem;
  line-height: 1.7;
}

.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 24px 0 0;
}

.qr-wrap figure {
  width: 280px;
  max-width: 100%;
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  color-scheme: light;
}

#qr-code {
  display: block;
  width: 280px;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  color-scheme: light;
  object-fit: contain;
}

.qr-wrap figure #qr-code {
  width: 100%;
  padding: 0;
  border-radius: 0;
}

.qr-loading {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
  text-align: center;
}

.recipient {
  margin-top: 22px;
}

.recipient dl,
dl.recipient {
  margin-bottom: 0;
}

.recipient dl > div,
dl.recipient > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding-block: 8px;
  border-bottom: 1px solid #25313a;
}

.recipient dl > div:last-child,
dl.recipient > div:last-child {
  border-bottom: 0;
}

.recipient dt {
  color: var(--subtle);
  font-size: 0.875rem;
  line-height: 1.6;
}

.recipient dd {
  min-width: 0;
  margin: 0;
  color: #e1e8ee;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.recipient dd code,
.recipient dd.account-number,
.recipient dd .account-number {
  font-family: var(--mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--emerald-light);
  font-size: 0.875rem;
  vertical-align: middle;
}

.qr-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.qr-actions a,
.qr-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 46px;
  padding: 10px 8px;
  border: 1px solid #35424d;
  border-radius: 8px;
  background: #1a252d;
  color: #e0e9ef;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.payment-note {
  margin: 18px 0 0;
  color: var(--subtle);
  font-size: 0.875rem;
  line-height: 1.7;
}

#form-error {
  margin: 10px 0 0;
  color: #fca5a5;
  font-size: 0.875rem;
  line-height: 1.6;
}

#form-error:empty {
  display: none;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding-block: 22px 26px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 0.875rem;
  line-height: 1.7;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #c6d4de;
}

#toast {
  position: fixed;
  z-index: 20;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  transform: translate(-50%, 8px);
  border: 1px solid #3a6c55;
  border-radius: 10px;
  background: #183a2a;
  box-shadow: 0 8px 32px #0006;
  color: #d7f9e7;
  font-size: 0.9375rem;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
}

#toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

#toast:empty {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript-note {
  max-width: 560px;
  margin: 24px auto;
  padding-inline: 16px;
  color: var(--muted);
}

@media (hover: hover) {
  .repo-link:hover,
  .site-footer a:hover {
    color: var(--emerald-light);
  }

  .primary-link:hover {
    background: #34d399;
  }

  .secondary-link:hover,
  .qr-actions a:hover,
  .qr-actions button:hover,
  .amount-chip:hover {
    border-color: #5c796d;
    background: #21322c;
  }

  .copy-button:hover {
    background: #23382e;
  }
}

@media (max-width: 1000px) {
  .site-shell {
    width: calc(100% - 48px);
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
    column-gap: 32px;
  }

  .donation-panel {
    padding: 24px;
  }
}

@media (max-width: 780px) {
  .site-shell {
    width: min(560px, calc(100% - 40px));
  }

  .topbar {
    min-height: 88px;
    gap: 12px;
    padding-block: 18px;
  }

  .header-actions {
    gap: 12px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding-block: 40px;
  }

  .intro {
    padding-top: 0;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.5rem, 7.7vw, 3.75rem);
  }

  .lead {
    margin-top: 20px;
    font-size: 1rem;
  }

  .eyebrow {
    margin-bottom: 18px;
  }

  .quick-links {
    margin-top: 24px;
  }

  .policy {
    max-width: none;
    margin-top: 32px;
    padding-left: 16px;
  }

  .donation-panel {
    padding: 24px;
    border-radius: 16px;
  }

  .site-footer {
    justify-content: flex-start;
    column-gap: 18px;
  }
}

@media (max-width: 420px) {
  .site-shell {
    width: calc(100% - 32px);
  }

  .topbar {
    flex-wrap: wrap;
  }

  .brand {
    gap: 8px;
  }

  .brand img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .brand-name {
    font-size: 1.25rem;
  }

  .header-actions {
    gap: 9px;
  }

  .repo-link {
    gap: 6px;
  }

  .language-switch button {
    padding-inline: 8px;
  }

  .hero {
    padding-top: 32px;
  }

  h1 {
    font-size: 2.625rem;
  }

  .donation-panel {
    padding: 20px;
  }

  .recipient dl > div,
  dl.recipient > div {
    grid-template-columns: 83px minmax(0, 1fr);
    column-gap: 10px;
  }

  .qr-actions {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
