@font-face {
  font-family: "DM Sans";
  src: url("/fonts/dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #101017;
  --panel: #171721;
  --border: #30303f;
  --text: #f7f5fe;
  --muted: #bab7ce;
  --accent: #c5b4ff;
  --accent-bright: #bda8ff;
  --sans: "DM Sans", system-ui, sans-serif;
  --display: "Space Grotesk", var(--sans);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(1168px, calc(100% - 80px)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 5; left: 12px; top: 12px; padding: 10px; background: var(--panel); }

.topbar { border-bottom: 1px solid #242431; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font: 700 1.22rem var(--display); letter-spacing: -.045em; }
.brand-last { color: var(--accent); }
.brand-icon { display: grid; place-items: center; inline-size: 34px; block-size: 34px; border-radius: 9px; background: var(--accent-bright); }
.brand-icon span {
  width: 22px;
  height: 8px;
  background: #211735;
  transform: rotate(-45deg);
  clip-path: polygon(0 50%, 23% 0, 80% 0, 80% 100%, 23% 100%, 0 50%, 88% 50%, 88% 0, 100% 0, 100% 100%, 88% 100%, 88% 50%);
}
nav a { display: inline-block; color: var(--muted); padding: 10px 1px; font-weight: 600; }
nav a:hover, .footer a:hover, .text-link:hover { color: var(--accent); }

.hero {
  margin-top: 34px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: 429px;
  border: 1px solid #343045;
  border-radius: 24px;
  background: #171323;
}
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #171323 2%, #171323 27%, #171323e8 38%, #17132312 62%, transparent 82%);
}
.hero-art {
  position: absolute;
  z-index: -2;
  inset: 0 0 0 auto;
  width: 74%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
}
.hero-copy { padding: 38px 60px 42px; }
.hero h1 {
  font: 700 clamp(3.6rem, 6.8vw, 6.75rem)/.91 var(--display);
  letter-spacing: -.09em;
  width: fit-content;
  padding-right: .1em;
}
.hero h1 span { color: var(--accent); }
.hero p { color: #d2cee1; font-size: 1.125rem; line-height: 1.5; margin: 24px 0 26px; max-width: 305px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; line-height: 1.25; }
.button-primary { background: var(--accent-bright); color: #1a122c; }
.button-primary:hover { background: #d7c9ff; }
.button-secondary { background: #202031; color: var(--text); border-color: #39384b; }
.button-secondary:hover { background: #2c2941; border-color: #66558c; }
.icon { display: inline-block; flex: none; position: relative; vertical-align: middle; }
.icon-chevron, .icon-up { width: 8px; height: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); margin-left: 3px; }
.icon-up { transform: translateY(2px) rotate(225deg); }
.icon-search { width: 14px; height: 14px; border: 1.6px solid currentColor; border-radius: 50%; }
.icon-search::after { content: ""; position: absolute; right: -4px; bottom: -2px; transform: rotate(45deg); width: 6px; height: 1.6px; background: currentColor; }
.icon-package { width: 20px; height: 19px; border-radius: 3px; border: 1.5px solid currentColor; }
.icon-package::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; border-top: 1.5px solid currentColor; }
.icon-package::after { content: ""; position: absolute; top: 8px; left: 6px; width: 5px; border-top: 1.5px solid currentColor; }

.catalog { padding: 46px 0 58px; scroll-margin-top: 20px; }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 20px; }
h2 { font: 700 2.12rem/1.1 var(--display); letter-spacing: -.055em; overflow-wrap: anywhere; }
.count { color: var(--muted); font-size: .875rem; margin-top: 6px; min-height: 1.2em; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; align-items: center; }
.search-box, .select-box { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); min-height: 46px; color: var(--muted); }
.search-box { gap: 12px; padding: 0 10px 0 15px; width: min(306px, 100%); }
.search-box:focus-within, .select-box:focus-within { border-color: var(--accent); }
.search-box input, .select-box select { border: 0; background: transparent; color: var(--text); outline: none; padding: 10px 0; min-height: 44px; }
.search-box input { flex: 1; min-width: 0; width: 100%; }
.search-box input::placeholder { color: #ada9c1; }
.search-box kbd { color: #c5bfd8; font: .875rem var(--sans); padding: 0 7px; border: 1px solid #474357; border-radius: 4px; }
.select-box { position: relative; max-width: 100%; }
.select-box::after { content: ""; position: absolute; right: 13px; width: 7px; height: 7px; transform: translateY(-2px) rotate(45deg); border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; pointer-events: none; }
.select-box select { padding-inline: 12px 28px; appearance: none; min-width: 0; width: 100%; cursor: pointer; font-size: .875rem; }
.select-box option { background: var(--panel); color: var(--text); }

.empty { border: 1px dashed #373445; background: #14141e; padding: 28px 16px; min-height: 166px; border-radius: 14px; text-align: center; display: grid; justify-items: center; align-content: center; gap: 9px; }
.empty-icon { color: var(--accent); background: #242037; border: 1px solid #413657; border-radius: 10px; inline-size: 40px; block-size: 40px; display: grid; place-items: center; margin-bottom: 3px; }
.empty h3 { font: 700 1rem var(--display); }
.empty p { color: var(--muted); font-size: .9375rem; line-height: 1.45; max-width: 40ch; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; align-items: flex-start; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 19px; min-width: 0; }
.card:hover { border-color: #554869; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%; min-width: 0; }
.program-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: #2c2440; color: var(--accent); font: 700 .94rem var(--display); }
.tag { display: inline-block; font-size: .8125rem; line-height: 1.3; background: #251f37; color: #ddcfff; padding: 4px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.card h3 { font: 700 1.375rem/1.15 var(--display); letter-spacing: -.035em; margin-top: 14px; max-width: 100%; overflow-wrap: anywhere; }
.card .description { margin-top: 9px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; max-width: 100%; }
.meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin: 14px 0 16px; padding: 0; color: var(--muted); font-size: .8125rem; list-style: none; max-width: 100%; overflow-wrap: anywhere; }
.meta li { min-width: 0; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; margin-top: auto; width: 100%; border-top: 1px solid #2d2b3a; padding-top: 14px; }
.card-actions .button { font-size: .875rem; }
.text-link { color: var(--muted); font-weight: 600; font-size: .875rem; padding: 10px 0; }
.footer { border-top: 1px solid #252532; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; color: var(--muted); font-size: .875rem; }
.footer-name { color: #d2cbe5; font-family: var(--display); font-weight: 600; }

dialog { width: min(600px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; background: var(--panel); color: var(--text); border: 1px solid #4a435d; border-radius: 16px; padding: 0; overflow: auto; }
dialog::backdrop { background: #090710be; }
.dialog-top { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding: 21px; }
.project-source { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; margin-bottom: 4px; }
.close { min-width: 44px; padding: 0; font-size: 1.4rem; align-self: start; }
.dialog-content { padding: 20px 21px; display: grid; gap: 15px; }
.release-info, .release-note { color: var(--muted); overflow-wrap: anywhere; }
.files { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.file-link { border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 8px 11px; }
.file-link:hover { border-color: var(--accent); }
.file-link span:first-child { overflow-wrap: anywhere; min-width: 0; }
.file-size { color: var(--muted); font-size: .8125rem; flex: none; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 950px) {
  .shell { width: calc(100% - 48px); }
  .hero-copy { padding-inline: 40px; }
  .hero { min-height: 380px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 630px) {
  .shell { width: calc(100% - 32px); }
  .topbar-inner { min-height: 62px; }
  .hero { margin-top: 16px; display: block; min-height: 0; border-radius: 16px; }
  .hero-art { position: relative; width: 100%; height: auto; aspect-ratio: 2 / 1; display: block; object-fit: cover; object-position: center 49%; }
  .hero::after { inset: 0 0 auto; height: 53vw; max-height: 330px; background: linear-gradient(180deg, transparent 60%, #171323); }
  .hero-copy { padding: 0 23px 27px; }
  .hero h1 { font-size: clamp(3rem, 12.6vw, 4.75rem); }
  .hero p { font-size: 1.0625rem; margin: 16px 0 20px; }
  .catalog { padding: 33px 0 40px; }
  .toolbar { width: 100%; justify-content: flex-start; }
  .search-box { width: 100%; }
  .search-box kbd { display: none; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
