:root {
  color-scheme: dark;
  --accent: #805AD5;
  --accent-hover: #6B46C1;
  --accent-active: #553C9A;
  --bg: #000;
  --text: #fff;
  --text-muted: rgba(255, 255, 255, 0.85);
  --overlay: linear-gradient(to right, rgba(48, 7, 71, 0.6), rgba(30, 7, 51, 0));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  background-size: cover;
  background-position: center center;
  display: flex;
}

.page-overlay {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--overlay);
  padding: 1rem 2rem;
}

.page-content {
  max-width: 42rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.headline {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

@media (min-width: 768px) {
  .headline { font-size: 3rem; }
}

.button-row {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--text);
  text-decoration: none;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background 120ms ease;
}

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

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ─── Listing page (Website/vpm/) ─────────────────────────────── */

.listing-overlay {
  display: block;
  padding: 0;
  background: linear-gradient(to right, rgba(48, 7, 71, 0.6), rgba(30, 7, 51, 0));
}

.listing-header {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto 2rem auto;
}

.listing-header h1 {
  font-size: 2rem;
  margin: 0.5rem 0;
}

.listing-header p {
  color: var(--text-muted);
  margin: 0 0 1rem 0;
}

.listing-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 2rem 4rem 2rem;
}

.back-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.add-vcc-row {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 2rem 0;
  flex-wrap: wrap;
}

.add-vcc-row .vpm-url {
  flex: 1;
  min-width: 16rem;
  padding: 0.5rem 0.75rem;
  background: rgba(35, 3, 53, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text);
  border-radius: 0.375rem;
  font-family: monospace;
  font-size: 0.875rem;
  outline: none;
}

.add-vcc-row .vpm-url:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(128, 90, 213, 0.35);
}

.package-card {
  background: rgba(35, 3, 53, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.package-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 0.25rem 0;
}

.package-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.package-id {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
}

.package-description {
  margin: 0 0 1rem 0;
}

.version-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.15rem 0.55rem;
  border-radius: 0.25rem;
  font-family: monospace;
  font-size: 0.85rem;
}

.package-repo-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

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

footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

/* ─── Entrance animations ─────────────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  /* Portal */
  .headline   { animation: fadeIn 0.5s 0.2s ease-out both; }
  .button-row { animation: fadeIn 0.5s 0.4s ease-out both; }

  /* Listing */
  .back-row         { animation: fadeIn 0.5s 0.2s ease-out both; }
  .listing-header   { animation: fadeIn 0.5s 0.4s ease-out both; }
  .package-list     { animation: fadeIn 0.5s 0.6s ease-out both; }
  .listing-content > footer { animation: fadeIn 0.5s 0.8s ease-out both; }
}
