:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1f2937;
  --muted: #64748b;
  --accent: #f97316;
  --accent-2: #2563eb;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Roboto", Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #e8eef7 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 28px;
  background: rgba(246, 248, 251, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar .brand { font-weight: 600; font-size: 1.1rem; }

main { max-width: 980px; margin: 0 auto; padding: 0 24px 60px; }

.hero { padding: 40px 0 0; text-align: center; }
.hero h1 {
  margin: 0 0 8px;
  font-size: 2.6rem;
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--accent) 35%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .tagline { font-size: 1.2rem; color: var(--text); }
.hero .desc { max-width: 640px; margin: 0 auto 28px; color: var(--muted); }

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s, filter 0.12s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { border-color: #9aa7ba; }

.projects h2 { font-size: 1.6rem; }
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.project-card h3 { margin: 0 0 8px; }
.project-card .pdesc { margin: 0 0 18px; color: var(--muted); font-size: 0.94rem; }
.project-card .actions { display: flex; flex-wrap: wrap; gap: 10px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 48px 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.card h3 { margin: 0 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 0.94rem; }

.download { margin-top: 52px; }
.download h2, .changelog-section h2 { font-size: 1.6rem; }
.download .hint { color: var(--muted); margin-top: 0; }

.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.dl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.dl-card h3 { margin: 0 0 6px; }
.dl-card .vmeta, .dl-card .v-sub { margin: 0 0 16px; color: var(--muted); font-size: 0.9rem; }
.dl-card .btn { display: block; text-align: center; }

.checksum { margin: 18px 0 0; color: var(--muted); font-size: 0.82rem; word-break: break-all; }
.checksum code { background: #eef2f7; padding: 2px 6px; border-radius: 4px; color: #2563eb; }
.sha-label { color: var(--muted); margin-right: 6px; }
.dl-card .btn.disabled { background: var(--muted); color: #fff; pointer-events: none; filter: none; }

.note { color: var(--muted); font-size: 0.9rem; margin-top: 28px; }

.changelog-section { margin-top: 64px; }
#changelog-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-x: auto;
}
.changelog-head,
.changelog-release {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  min-width: 600px;
}
.changelog-head-cell {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.changelog-col {
  display: flex;
  flex-direction: column;
}
.changelog-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  min-height: 100%;
}
.changelog-entry h4 { margin: 0 0 4px; }
.changelog-entry .pmeta { color: var(--muted); font-size: 0.85rem; margin: 0 0 8px; }
.changelog-entry p { margin: 0; color: var(--text); font-size: 0.95rem; }
.changelog-entry .empty { color: var(--muted); }

.support-wrap,
.donation-wrap {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.support-fab,
.donation-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.20);
  transition: transform 0.12s, filter 0.12s;
}
.support-fab:hover,
.donation-fab:hover { transform: translateY(-2px); filter: brightness(1.05); }
.support-options,
.donation-options {
  display: none;
  flex-direction: row;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.16);
}
.support-wrap:hover .support-options,
.support-wrap.open .support-options,
.donation-wrap:hover .donation-options,
.donation-wrap.open .donation-options { display: flex; }
.support-options .btn,
.donation-options .btn {
  white-space: nowrap;
  padding: 10px 18px;
  font-size: 14px;
}
.support-options .btn.primary,
.donation-options .btn.primary { border: none; }
.support-options .btn.secondary,
.donation-options .btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.support-options .btn.secondary:hover,
.donation-options .btn.secondary:hover { border-color: #9aa7ba; }

.donation-kofi-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 102;
  padding: 16px;
}
.donation-kofi-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 420px;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
  position: relative;
  padding: 28px 4px 4px;
}
.donation-kofi-close {
  position: absolute;
  top: 6px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

footer {
  border-top: 1px solid var(--border);
  padding: 22px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}