:root {
  color-scheme: dark;
  --background: #080a0f;
  --surface: #10141c;
  --surface-raised: #161b25;
  --surface-soft: #0d1118;
  --border: #252c39;
  --border-strong: #364052;
  --text: #f5f7fb;
  --text-muted: #9ca7b8;
  --text-dim: #6f7a8c;
  --accent: #8b9dff;
  --accent-strong: #7186ff;
  --accent-soft: rgb(139 157 255 / 12%);
  --success: #65d99a;
  --shadow: 0 28px 80px rgb(0 0 0 / 34%);
  --radius-small: 12px;
  --radius-medium: 20px;
  --radius-large: 30px;
  --page-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgb(113 134 255 / 10%), transparent 30rem),
    radial-gradient(circle at 88% 34%, rgb(101 217 154 / 6%), transparent 26rem),
    var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--text);
  color: var(--background);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

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

.site-header,
main,
.site-footer {
  width: min(var(--page-width), calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  border-bottom: 1px solid rgb(255 255 255 / 7%);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 720;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 10px;
  background: linear-gradient(145deg, #9cabff, #5e74ef);
  box-shadow: 0 8px 22px rgb(83 105 224 / 28%);
  color: white;
  font-size: 1rem;
  font-weight: 800;
}

.brand-mark.has-image {
  overflow: hidden;
  padding: 0;
  background: var(--surface-raised);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 620;
  text-decoration: none;
  transition: color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: clamp(48px, 8vw, 112px);
  align-items: center;
  min-height: 650px;
  padding-block: 90px 110px;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgb(101 217 154 / 10%);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(3.4rem, 7.2vw, 6.9rem);
  font-weight: 760;
  letter-spacing: -0.072em;
  line-height: 0.92;
}

h1 span {
  color: var(--accent);
}

.hero-description {
  max-width: 560px;
  margin-bottom: 34px;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 1.7vw, 1.24rem);
  line-height: 1.65;
}

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

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-size: 0.92rem;
  font-weight: 720;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--accent-strong);
  box-shadow: 0 12px 32px rgb(83 105 224 / 25%);
  color: white;
}

.button-primary:hover {
  background: #8092ff;
}

.button-secondary {
  border-color: var(--border);
  background: rgb(255 255 255 / 3%);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--border-strong);
  background: rgb(255 255 255 / 6%);
}

.source-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: linear-gradient(155deg, rgb(255 255 255 / 5%), rgb(255 255 255 / 1.5%));
  box-shadow: var(--shadow);
}

.source-card::before {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  filter: blur(90px);
  opacity: 0.18;
  pointer-events: none;
}

.source-card-heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 17px;
  color: var(--text-muted);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.source-state {
  padding: 5px 9px;
  border: 1px solid rgb(101 217 154 / 18%);
  border-radius: 999px;
  background: rgb(101 217 154 / 8%);
  color: var(--success);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.source-card code {
  position: relative;
  display: block;
  min-height: 60px;
  padding: 18px;
  overflow-wrap: anywhere;
  border: 1px solid rgb(255 255 255 / 6%);
  border-radius: 14px;
  background: rgb(0 0 0 / 22%);
  color: #dce2ff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
}

.copy-button {
  position: relative;
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease;
}

.copy-button:hover {
  border-color: var(--border-strong);
  background: #1c2230;
}

.repository-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 26px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.repository-stats div:not(:first-child) {
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.repository-stats dt {
  margin-bottom: 4px;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.repository-stats dd {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

.catalog {
  padding-block: 110px 130px;
  border-top: 1px solid rgb(255 255 255 / 7%);
}

.section-heading {
  display: flex;
  gap: 30px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 34px;
}

.section-heading .eyebrow {
  margin-bottom: 9px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

.search-field input {
  width: min(290px, 35vw);
  min-height: 45px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-field input::placeholder {
  color: var(--text-dim);
}

.search-field input:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.package-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.package-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 24px 60px rgb(0 0 0 / 20%);
  transform: translateY(-3px);
}

.package-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}

.package-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgb(139 157 255 / 28%);
  border-radius: 15px;
  background: var(--accent-soft);
  color: #bdc7ff;
  font-size: 0.82rem;
  font-weight: 820;
  letter-spacing: -0.02em;
}

.package-icon.has-image {
  overflow: hidden;
  padding: 0;
  background: var(--surface-raised);
}

.package-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.version-pill,
.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgb(255 255 255 / 3%);
  color: var(--text-muted);
  font-size: 0.69rem;
  font-weight: 720;
}

.version-pill {
  padding: 6px 10px;
}

.package-card h3 {
  margin-bottom: 6px;
  font-size: 1.38rem;
  letter-spacing: -0.035em;
}

.package-card h3 a {
  text-decoration: none;
}

.package-card h3 a::after {
  position: absolute;
  inset: 0;
  content: "";
}

.package-card {
  position: relative;
}

.package-identifier {
  margin-bottom: 18px;
  color: var(--text-dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.73rem;
}

.package-description {
  margin-bottom: 24px;
  color: var(--text-muted);
  line-height: 1.65;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  margin-bottom: 24px;
}

.badge {
  padding: 5px 9px;
}

.package-actions {
  position: relative;
  z-index: 2;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.text-link {
  color: #bdc7ff;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  color: white;
}

.empty-state,
.load-error {
  padding: 36px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-medium);
  color: var(--text-muted);
  text-align: center;
}

.package-card-loading,
.detail-loading {
  min-height: 230px;
}

.loading-line {
  height: 13px;
  margin-bottom: 15px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--surface-raised), #242b38, var(--surface-raised));
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}

.loading-title {
  width: 45%;
  height: 25px;
  margin-top: 40px;
}

.loading-short {
  width: 65%;
}

.detail-shell {
  min-height: calc(100vh - 180px);
  padding-block: 60px 120px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 34px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 680;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.6fr);
  gap: 28px;
  align-items: start;
}

.detail-main,
.detail-sidebar,
.changelog {
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
}

.detail-main {
  padding: clamp(30px, 5vw, 56px);
}

.detail-heading {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}

.detail-heading .package-icon {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 19px;
  font-size: 1rem;
}

.detail-heading h1 {
  margin: 0 0 5px;
  font-size: clamp(2.35rem, 5vw, 4.6rem);
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.detail-description {
  max-width: 760px;
  margin-bottom: 30px;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.72;
}

.detail-main .badge-row {
  margin: 0 0 30px;
}

.detail-sidebar {
  padding: 28px;
}

.detail-sidebar h2,
.changelog h2 {
  margin-bottom: 22px;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.metadata-list {
  margin: 0;
}

.metadata-list div {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.metadata-list div:last-child {
  border-bottom: 0;
}

.metadata-list dt {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.metadata-list dd {
  margin: 0;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 680;
  text-align: right;
}

.compatibility-note {
  margin: 24px 0 0;
  padding: 15px;
  border: 1px solid rgb(101 217 154 / 14%);
  border-radius: 13px;
  background: rgb(101 217 154 / 6%);
  color: #a7ddbd;
  font-size: 0.78rem;
  line-height: 1.55;
}

.changelog {
  margin-top: 28px;
  padding: clamp(28px, 4vw, 42px);
}

.release-entry {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 30px;
  padding: 25px 0;
  border-top: 1px solid var(--border);
}

.release-version {
  margin-bottom: 5px;
  font-weight: 760;
}

.release-date {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.release-entry ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.release-entry li + li {
  margin-top: 8px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 100px;
  border-top: 1px solid rgb(255 255 255 / 7%);
  color: var(--text-dim);
  font-size: 0.78rem;
}

.site-footer p {
  margin: 0;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: #1c2230;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes shimmer {
  to { background-position: -220% 0; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-block: 80px 95px;
  }

  .source-card {
    max-width: 600px;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 30px, var(--page-width));
  }

  .site-header {
    min-height: 74px;
  }

  .site-nav {
    gap: 16px;
  }

  .site-nav a:first-child {
    display: none;
  }

  .hero {
    gap: 55px;
    padding-block: 68px 80px;
  }

  h1 {
    font-size: clamp(3rem, 17vw, 5.2rem);
  }

  .source-card,
  .package-card,
  .detail-main,
  .detail-sidebar,
  .changelog {
    border-radius: 20px;
  }

  .source-card,
  .package-card {
    padding: 22px;
  }

  .catalog {
    padding-block: 80px 95px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field input {
    width: 100%;
  }

  .package-grid {
    grid-template-columns: 1fr;
  }

  .repository-stats div:not(:first-child) {
    padding-left: 12px;
  }

  .detail-shell {
    padding-block: 36px 80px;
  }

  .detail-main,
  .detail-sidebar,
  .changelog {
    padding: 24px;
  }

  .detail-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .release-entry {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
