:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --plus: #10b981;
  --rtk: #6366f1;
  --border: #2d3a4f;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--accent);
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

/* Header */
.site-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.brand img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.brand h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 640px;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 0 40px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

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

/* Editions */
.editions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.edition {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.edition::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.edition.rtk::before {
  background: var(--rtk);
}

.edition.plus::before {
  background: var(--plus);
}

.edition h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.edition .tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.edition.rtk .tag {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.edition.plus .tag {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.edition ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Downloads */
.section-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.section-hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 20px;
}

.manifest-updated {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.download-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.download-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 16px;
  align-items: center;
}

.download-item.is-latest {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.download-meta h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
}

.badge.edition-rtk {
  background: var(--rtk);
}

.badge.edition-plus {
  background: var(--plus);
}

.download-meta .sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.download-meta .changelog {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--text);
  opacity: 0.9;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-download:hover {
  background: var(--accent-hover);
}

.btn-download svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.empty-state {
  text-align: center;
  padding: 40px 24px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty-state code {
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

.error-state {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

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

@media (max-width: 560px) {
  .download-item {
    grid-template-columns: 1fr;
  }

  .btn-download {
    justify-content: center;
    width: 100%;
  }
}
