:root {
  --bg: #0b0f17;
  --surface: #121a27;
  --surface2: #1a2438;
  --border: #2a3650;
  --text: #e8edf7;
  --muted: #8b9bb8;
  --accent: #6366f1;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: "Inter", system-ui, sans-serif;
}

html[lang="fa"] {
  font-family: "Vazirmatn", "Inter", system-ui, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.container {
  width: min(1100px, 92vw);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.header {
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 23, 0.85);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.powered {
  color: var(--muted);
  font-size: 0.85rem;
}

.np-link {
  color: #7dd3fc;
  font-weight: 600;
  text-decoration: none;
}

.np-link:hover {
  text-decoration: underline;
}

.lang-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font: inherit;
  cursor: pointer;
}

.intro-section {
  margin-bottom: 2.5rem;
  padding-top: 2rem;
}

.page-intro {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2rem;
}

.page-intro h1 {
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  margin: 0 0 0.85rem;
  line-height: 1.25;
}

.page-thanks,
.page-support {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.page-support {
  margin-bottom: 0;
}

.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2.5rem 1rem 3rem;
  min-height: 12rem;
}

.page-loading.hidden {
  display: none;
}

.page-loading-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: page-loading-spin 0.75s linear infinite;
}

@keyframes page-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.page-loading-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-content.hidden {
  display: none;
}

.developer-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow);
}

.developer-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.developer-profile {
  min-width: 0;
  text-align: start;
}

.developer-name {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.developer-bio {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.developer-github {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.developer-github:hover {
  text-decoration: underline;
}

.developer-donate.pay-actions {
  flex-shrink: 0;
  min-width: 11.5rem;
  margin: 0;
}

.section-title {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
  color: var(--text);
}

.section-lead {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 1rem;
  max-width: 640px;
  line-height: 1.5;
}

.pay-btn-outline {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}

.pay-btn-outline:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface2));
}

@media (max-width: 768px) {
  .developer-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .developer-profile {
    text-align: center;
  }

  .developer-donate.pay-actions {
    width: 100%;
    max-width: 280px;
  }
}

.repos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.repo-card {
  text-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.15s, transform 0.15s;
}

.repo-card-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.repo-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.repo-card:hover {
  border-color: color-mix(in srgb, var(--card-accent, var(--accent)) 50%, var(--border));
  transform: translateY(-2px);
}

.repo-card strong {
  font-size: 1rem;
}

.repo-short {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.projects-section {
  padding-bottom: 3rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  font: inherit;
}

.tab.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface2));
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  background: color-mix(in srgb, var(--accent) 35%, var(--surface2));
  color: var(--text);
}

.tab.active .tab-badge {
  background: color-mix(in srgb, var(--accent) 55%, var(--surface2));
}

.tab-badge--zero {
  opacity: 0.55;
}

.repo-badge {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.status-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

.status-active {
  background: color-mix(in srgb, #10b981 25%, transparent);
  color: #6ee7b7;
}

.status-fulfilled {
  background: color-mix(in srgb, #6366f1 25%, transparent);
  color: #a5b4fc;
}

.status-rejected {
  background: color-mix(in srgb, #ef4444 25%, transparent);
  color: #fca5a5;
}

.progress-wrap {
  margin: 0.75rem 0 1rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.progress-bar {
  height: 8px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--card-accent, var(--accent));
  border-radius: 99px;
  transition: width 0.3s;
}

.history-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.modal-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

html[dir="rtl"] .modal-close {
  right: auto;
  left: 0.75rem;
}

.modal-panel--donate {
  max-width: 480px;
}

.modal-project-summary {
  padding-inline-end: 2rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-project-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.modal-project-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.modal-project-text {
  min-width: 0;
  flex: 1;
}

.modal-tagline {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-progress {
  margin-top: 0.85rem;
}

.modal-donate-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.progress-remaining {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.remaining-value {
  font-weight: 600;
  color: var(--accent);
}

.progress-label {
  color: var(--muted);
  font-weight: 500;
}

.card-donate-btn {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

.card-donate-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.modal-repo-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-inline-end: 2rem;
}

.modal-repo-img {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

.modal-repo-text {
  min-width: 0;
  flex: 1;
}

.modal-title {
  margin: 0 0 0.5rem;
}

.modal-desc {
  color: var(--muted);
  margin: 0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.modal-actions .amount-btn {
  width: auto;
  flex: 1;
  min-width: 140px;
}

.modal-support-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.modal-payments {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  padding-bottom: 4rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s, transform 0.2s;
}

.project-card:hover {
  border-color: color-mix(in srgb, var(--card-accent, var(--accent)) 50%, var(--border));
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-header-main {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.project-repo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.card-title {
  margin: 0;
  font-size: 1.35rem;
}

.card-tagline {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.repo-link {
  color: var(--card-accent, var(--accent));
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.repo-link:hover {
  text-decoration: underline;
}

.stats-box {
  background: var(--surface2);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.stats-label {
  color: var(--muted);
  display: block;
}

.stats-value {
  font-weight: 600;
  font-size: 1.05rem;
}

.amount-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.amount-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.amount-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.amount-btn:hover,
.amount-btn.active {
  border-color: var(--card-accent, var(--accent));
  background: color-mix(in srgb, var(--card-accent, var(--accent)) 18%, var(--surface2));
}

.custom-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.custom-row input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: var(--text);
  font: inherit;
  min-width: 0;
}

.custom-row input:focus {
  outline: 2px solid color-mix(in srgb, var(--card-accent, var(--accent)) 60%, transparent);
  border-color: var(--card-accent, var(--accent));
}

.donor-fields {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.donor-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.donor-label input,
.donor-label textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: var(--text);
  font: inherit;
  resize: vertical;
  min-height: 2.5rem;
}

.donor-label input:focus,
.donor-label textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--card-accent, var(--accent)) 60%, transparent);
  border-color: var(--card-accent, var(--accent));
}

.pay-methods-label {
  margin-top: 0.25rem;
}

.pay-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, background 0.15s, border-color 0.15s;
}

.pay-btn-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: contain;
}

.pay-btn-np,
.donate-btn.pay-btn-np {
  border: none;
  background: #00c26f;
  color: #fff;
}

.pay-btn-np:hover:not(:disabled),
.donate-btn.pay-btn-np:hover:not(:disabled) {
  filter: brightness(1.08);
}

.donate-btn.pay-btn-np:disabled {
  opacity: 0.6;
  cursor: wait;
}

.pay-btn-bmc {
  border: 1px solid #fbbf24;
  background: color-mix(in srgb, #fbbf24 12%, var(--surface2));
  color: #fcd34d;
}

.pay-btn-bmc:hover {
  filter: brightness(1.08);
  background: color-mix(in srgb, #fbbf24 22%, var(--surface2));
}

.stats-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
  line-height: 1.4;
}

.np-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.np-badge a {
  color: #7dd3fc;
  text-decoration: none;
}

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

.donations-section {
  padding-bottom: 2.5rem;
}

.donations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.donations-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.donations-block-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  color: var(--text);
}

.donations-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.donation-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  padding: 0.7rem 0.8rem;
  background: var(--surface2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.donation-row-start {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  flex-shrink: 0;
}

.donation-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
  background: color-mix(in srgb, var(--accent) 25%, var(--surface2));
  color: var(--text);
}

.donation-payment {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  flex-shrink: 0;
}

.donation-payment-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.donation-amount {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  white-space: nowrap;
}

.donation-donor {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
  text-align: end;
}

html[dir="rtl"] .donation-donor {
  text-align: start;
  align-items: flex-start;
}

.donation-name {
  font-weight: 600;
  font-size: 0.95rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donation-comment {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.donation-date {
  font-size: 0.75rem;
  color: var(--muted);
}

.donations-empty {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 0.5rem 0;
}

@media (max-width: 720px) {
  .donations-grid {
    grid-template-columns: 1fr;
  }
}

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-inner {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner p {
  margin: 0.35rem 0;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 250;
  max-width: 90vw;
  text-align: center;
}

html[dir="rtl"] .toast {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.toast.hidden {
  display: none;
}

.toast.success {
  border-color: #10b981;
}

.toast.error {
  border-color: #ef4444;
}

@media (max-width: 520px) {
  .card-header {
    flex-direction: column;
  }
}
