:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #21262d;
  --border: #30363d;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --success: #3fb950;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
  --radius: 8px;
  --nav-height: 60px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAVBAR ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(22, 27, 34, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; color: var(--text); }

.brand-icon {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #0d1117;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
}

.nav-links a {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: rgba(88,166,255,0.1); }

.nav-social {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav-social a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-social a:hover { color: var(--text); background: var(--surface2); text-decoration: none; }

/* ── LAYOUT ── */
.page-wrap {
  display: flex;
  flex: 1;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
  gap: 32px;
}

.sidebar {
  width: 196px;
  flex-shrink: 0;
}

.sidebar-nav {
  position: sticky;
  top: calc(var(--nav-height) + 16px);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-section {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}
.sidebar-section:first-child { padding-top: 0; }

.sidebar-nav a {
  display: block;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s, background 0.15s;
  border-left: 2px solid transparent;
}
.sidebar-nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.sidebar-nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(88,166,255,0.08);
}

.main-content { flex: 1; min-width: 0; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.card:last-child { margin-bottom: 0; }

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title svg { flex-shrink: 0; }

/* ── HERO CARD ── */
.hero-card {
  background: linear-gradient(135deg, #161b22 0%, #1a2332 60%, #161b22 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  margin-bottom: 20px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.hero-body { flex: 1; min-width: 0; }

.hero-title {
  font-size: 34px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.version-badge {
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
  background: rgba(63,185,80,0.12);
  border: 1px solid rgba(63,185,80,0.35);
  color: var(--success);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.hero-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 520px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-screenshot { width: 240px; flex-shrink: 0; }
.hero-screenshot img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: var(--font);
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn svg { flex-shrink: 0; }

.btn-primary { background: var(--accent); color: #0d1117; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #0d1117; }

.btn-secondary { background: var(--surface2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #2d333b; border-color: #444c56; color: var(--text); }

.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: rgba(88,166,255,0.1); color: var(--accent-hover); border-color: var(--accent-hover); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ── CHIPS ── */
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 4px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── SCREENSHOTS GRID ── */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.screenshot-item { display: flex; flex-direction: column; gap: 6px; }

.screenshot-item img {
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
  display: block;
  aspect-ratio: 200 / 135;
  object-fit: cover;
}
.screenshot-item img:hover { opacity: 0.82; border-color: var(--accent); transform: translateY(-2px); }

.screenshot-label {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-mono);
}

/* ── DOWNLOAD PAGE ── */
.dl-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.dl-source:last-child { border-bottom: none; padding-bottom: 0; }
.dl-source:first-child { padding-top: 0; }

.dl-source-info { flex: 1; min-width: 160px; }
.dl-source-name { font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.dl-source-desc { font-size: 13px; color: var(--text-muted); }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.badge-primary { background: rgba(88,166,255,0.12); color: var(--accent); border: 1px solid rgba(88,166,255,0.3); }
.badge-alt { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }

.req-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.req-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-muted); }
.req-list li::before { content: ''; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* ── CHANGELOG ── */
.release { padding: 22px 0; border-bottom: 1px solid var(--border); }
.release:last-child { border-bottom: none; padding-bottom: 0; }
.release:first-child { padding-top: 0; }

.release-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.release-version { font-size: 18px; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.release-date { font-size: 13px; color: var(--text-muted); }
.release-latest {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  background: rgba(63,185,80,0.12); color: var(--success); border: 1px solid rgba(63,185,80,0.3);
  text-transform: uppercase; letter-spacing: 0.06em;
}

.release-notes { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.release-notes li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.release-notes li::before { content: '•'; color: var(--accent); flex-shrink: 0; margin-top: 0; }

/* ── DONATE PAGE ── */
.donate-intro {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.donate-currency-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.donate-currency-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.donate-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.donate-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  width: 100%;
  line-height: 1.3;
}
.donate-btn:hover { background: rgba(88,166,255,0.12); border-color: var(--accent); color: var(--accent); }

.donate-stats {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 13px;
  margin-top: 4px;
}
.donate-stats-title { font-weight: 600; color: var(--text); margin-bottom: 8px; }
.donate-stats table { border-collapse: collapse; }
.donate-stats td { padding: 3px 12px 3px 0; color: var(--text-muted); }
.donate-stats td:last-child { font-family: var(--font-mono); color: var(--text); padding-right: 0; }

/* ── MODAL ── */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0,0,0,0.88);
  overflow: auto;
  padding: 60px 20px 40px;
}

.modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.modal-img {
  display: block;
  max-width: min(90vw, 900px);
  max-height: 75vh;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
  animation: modalZoom 0.22s ease;
}

.modal-caption {
  color: #ccc;
  text-align: center;
  padding: 14px 0 0;
  font-size: 14px;
  animation: modalZoom 0.22s ease;
}

.modal-close {
  position: fixed;
  top: 14px;
  right: 22px;
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 36px;
  font-weight: 300;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
  padding: 6px;
}
.modal-close:hover { color: #fff; transform: scale(1.1); }

@keyframes modalZoom {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ── FOOTER ── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  gap: 16px;
  flex-wrap: wrap;
}
footer a { color: var(--accent); }
footer a:hover { text-decoration: underline; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-card { flex-direction: column; padding: 24px 20px; }
  .hero-screenshot { width: 100%; max-width: 380px; }
  .hero-title { font-size: 26px; }
  .donate-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .page-wrap { flex-direction: column; gap: 16px; padding: 20px 16px; }
  .sidebar { width: 100%; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; position: static; gap: 4px; }
  .sidebar-nav a { padding: 5px 10px; border-left: none; border-bottom: 2px solid transparent; }
  .sidebar-nav a.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .sidebar-section { display: none; }
  .screenshots-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar { padding: 0 16px; gap: 12px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 6px 8px; font-size: 13px; }
}

@media (max-width: 540px) {
  .screenshots-grid { grid-template-columns: 1fr 1fr; }
  .donate-grid { grid-template-columns: repeat(2, 1fr); }
}

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