:root {
  --bg: hsl(0, 9%, 7%);
  --bg-hover: hsl(0, 6%, 10%);
  --border-subtle: hsl(0, 5%, 12%);
  --text: hsl(0, 4%, 71%);
  --text-strong: hsl(0, 15%, 94%);
  --text-weak: hsl(0, 1%, 60%);
  --text-weaker: hsl(0, 3%, 28%);
  --accent: hsl(205, 32%, 62%);
  --accent-muted: hsl(205, 22%, 40%);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", -apple-system, sans-serif;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 24px;
}

header {
  border-bottom: 1px solid var(--border-subtle);
  padding: 20px 0;
  margin-bottom: 44px;
}

header .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

nav {
  display: flex;
  align-items: center;
  justify-content: center;
}

nav a {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8125rem;
  color: var(--text-weak);
  text-decoration: none;
  margin: 0 16px;
  padding: 3px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

nav a:hover { color: var(--text-strong); }

nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent-muted);
}

.view-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-muted);
  text-align: center;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-weak);
  font-size: 0.875rem;
  margin-bottom: 48px;
  text-align: center;
}

.subtitle a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.subtitle a:hover { color: var(--text-strong); }

.section { margin-bottom: 40px; }

.section-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent-muted);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-align: center;
}

.row-list { list-style: none; }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7ch 15ch 28px;
  padding: 12px 16px;
  margin: 0 -16px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.row.download { grid-template-columns: minmax(0, 1fr) auto; }

.row-main {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.row-main .label { grid-column: 1; }
.row-main .meta { grid-column: 2; text-align: right; }

.row:has(.row-main):hover {
  background: var(--bg-hover);
  border-left-color: var(--accent-muted);
}

.row .label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-strong);
}

.row .tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-weak);
  flex-shrink: 0;
  width: 10ch;
}

.row:hover .tag { color: var(--text-strong); }

.row .meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-weaker);
  flex-shrink: 0;
  transition: color 0.15s;
  opacity: 0.8;
}

.row:hover .meta { color: var(--text-weak); }

.details-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  grid-column: 4;
  width: 28px;
  margin-left: 0;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text-weaker);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.details-button:hover,
.details-button:focus-visible {
  border-color: var(--border-subtle);
  background: var(--bg);
  color: var(--text-strong);
  outline: none;
}

.details-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.1;
}

.password-button {
  grid-column: 3;
  width: 100%;
  flex-shrink: 0;
  padding: 3px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  background: transparent;
  color: var(--text-weak);
  cursor: copy;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6875rem;
  text-align: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.password-button:hover,
.password-button:focus-visible {
  border-color: var(--text-weaker);
  background: var(--bg);
  color: var(--text-strong);
  outline: none;
}

.details-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(920px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 20px 80px hsl(0 0% 0% / 0.55);
  transform: translate(-50%, -50%);
  overflow-y: auto;
}

.details-dialog::backdrop { background: hsl(0 0% 0% / 0.72); }

.dialog-panel { padding: 24px; }

.dialog-content {
  padding-right: 4px;
}

.dialog-description {
  margin-bottom: 20px;
  color: var(--text-weak);
  font-size: 0.8125rem;
  white-space: pre-line;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.dialog-kicker,
.dialog-section-title {
  color: var(--text-weak);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-heading h2 {
  margin-top: 4px;
  color: var(--text-strong);
  font-size: 1.125rem;
  font-weight: 500;
}

.dialog-close {
  border: 0;
  background: transparent;
  color: var(--text-weak);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover { color: var(--text-strong); }

.preview-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.preview-image {
  display: block;
  width: 100%;
  max-height: 420px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-hover);
  object-fit: contain;
}

.dialog-section-title { margin-bottom: 12px; }

.change {
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
}

.change-version {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
}
.change ul { padding-left: 18px; color: var(--text-weak); font-size: 0.8125rem; }

.dialog-link {
  display: inline-block;
  margin-top: 4px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  text-decoration: none;
}

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

@media (max-width: 520px) {
  header { margin-bottom: 40px; }
  nav { flex-wrap: wrap; width: 100%; gap: 8px 20px; }
  nav a { margin: 0; }
  .container { padding: 0 20px; }
  main.container { text-align: center; }
  .subtitle { max-width: 420px; margin-right: auto; margin-left: auto; }
  .row-list { text-align: left; }
  .row { margin: 0; padding: 11px 0; gap: 8px; }
  .row .meta { opacity: 0.65; }
  .dialog-panel { padding: 20px; }
  .preview-gallery { grid-template-columns: 1fr; }
}
