:root {
  color-scheme: dark;
  --bg: #0c0916;
  --surface: #151022;
  --surface-raised: #1f1733;
  --surface-overlay: #291e42;
  --text: #f6f1ff;
  --muted: #a79cbd;
  --line: #382c52;
  --line-bright: #584480;
  --accent: #a984ff;
  --accent-hover: #d4c4ff;
  --accent-dim: #7b52d9;
  --accent-glow: rgba(169, 132, 255, 0.25);
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -5%, #381c6b 0%, transparent 32rem),
    radial-gradient(circle at 88% 25%, rgba(110, 59, 192, 0.15) 0%, transparent 30rem),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

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

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(76rem, calc(100% - 2.5rem));
  margin: auto;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.15s;
}

.brand:hover {
  color: var(--accent-hover);
}

.brand__mark {
  color: var(--accent);
  font-size: 1.15rem;
  text-shadow: 0 0 10px var(--accent-glow);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  padding: 0.4rem 0.85rem;
  background: rgba(21, 16, 34, 0.85);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.12s;
}

.back-link:hover {
  border-color: var(--accent);
  background: var(--surface-raised);
  color: var(--accent-hover);
  transform: translateY(-1px);
}

.home {
  width: min(76rem, calc(100% - 2.5rem));
  margin: auto;
  padding: 4.5rem 0 6rem;
}

.home-intro {
  max-width: 44rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

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

h1 {
  margin-bottom: 1.1rem;
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
  font-weight: 900;
}

.home-intro > p:last-child {
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.toolbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin: 3rem 0 1.5rem;
}

.toolbar input {
  width: min(28rem, 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0;
  padding: 0.82rem 1.1rem;
  background: rgba(21, 16, 34, 0.95);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.toolbar input:focus {
  border-color: var(--accent-hover);
  border-left-color: var(--accent-hover);
  background: rgba(31, 23, 51, 0.98);
  box-shadow: 0 0 0 1px var(--accent-hover), 0 0 18px var(--accent-glow);
}

.toolbar input::placeholder {
  color: rgba(167, 156, 189, 0.6);
}

#project-count {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1.5rem;
}

.mod-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent-dim);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.4);
  text-decoration: none;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease, box-shadow 0.18s ease, border-top-color 0.18s ease;
}

.mod-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, transparent 50%, var(--accent-dim) 50%);
  transition: background 0.18s;
  pointer-events: none;
}

.mod-card:hover {
  border-color: var(--line-bright);
  border-top-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.55), 0 0 22px var(--accent-glow);
}

.mod-card:hover::after {
  background: linear-gradient(135deg, transparent 50%, var(--accent-hover) 50%);
}

.mod-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mod-card__banner {
  display: block;
  width: 100%;
  height: 9.5rem;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.placeholder-banner {
  background:
    linear-gradient(135deg, rgba(169, 132, 255, 0.15) 0%, transparent 60%),
    repeating-linear-gradient(45deg, rgba(56, 44, 82, 0.25) 0, rgba(56, 44, 82, 0.25) 12px, transparent 12px, transparent 24px),
    linear-gradient(135deg, #170d2c, #482382 60%, #291252);
}

.mod-card__body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 0 1.15rem 1.25rem;
}

.mod-card__heading {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  margin-top: -1.35rem;
  position: relative;
  z-index: 2;
}

.project-icon {
  display: block;
  flex: 0 0 3.35rem;
  width: 3.35rem;
  height: 3.35rem;
  border: 2px solid var(--line-bright);
  border-radius: 0;
  background: var(--surface-raised);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.project-icon--fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-dim), #391c66);
  border-color: var(--accent);
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 900;
  font-family: var(--font-mono);
}

.project-icon--large {
  flex-basis: 5.5rem;
  width: 5.5rem;
  height: 5.5rem;
  border: 3px solid var(--accent);
  border-radius: 0;
  font-size: 2.2rem;
  box-shadow: 0 0 0 2px #0c0916, 0 8px 24px rgba(0, 0, 0, 0.6);
}

.mod-card h2 {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.mod-card__version {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

.mod-card__description {
  min-height: 3.1em;
  margin: 1rem 0 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 0;
  padding: 0.25rem 0.65rem;
  background: #211834;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent-dim);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  white-space: nowrap;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tag--accent {
  background: #3c1e6d;
  border-color: var(--accent);
  border-left-color: var(--accent-hover);
  color: #fff;
  font-weight: 850;
}

.loading, .empty, .error {
  grid-column: 1 / -1;
  padding: 3.5rem 1rem;
  color: var(--muted);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

.error {
  color: #ffb7c1;
  border: 1px solid rgba(255, 183, 193, 0.3);
  background: rgba(255, 50, 80, 0.08);
}

.site-footer {
  width: min(76rem, calc(100% - 2.5rem));
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 3.5rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* Mod Detail Page */
#mod-page {
  width: min(76rem, calc(100% - 2.5rem));
  margin: 1.5rem auto 6rem;
}

.mod-banner {
  position: relative;
  display: flex;
  align-items: end;
  min-height: 22rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 0;
  background-color: #170d2c;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.5);
}

.mod-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 8, 22, 0.94) 0%, rgba(12, 8, 22, 0.55) 60%, rgba(12, 8, 22, 0.25) 100%),
    linear-gradient(0deg, rgba(12, 8, 22, 0.96) 0%, rgba(12, 8, 22, 0.45) 50%, transparent 100%);
}

.mod-banner__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.mod-banner__content {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1.5rem;
  align-items: end;
  padding: 2.25rem;
  width: 100%;
}

.mod-banner h1 {
  margin-bottom: 0.65rem;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.mod-banner__meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.mod-banner__authors {
  margin: 0;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.mod-banner__source {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--accent);
  border-radius: 0;
  padding: 0.32rem 0.85rem;
  background: rgba(43, 27, 72, 0.85);
  color: var(--accent-hover);
  font-size: 0.78rem;
  font-weight: 850;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.12s;
}

.mod-banner__source:hover {
  border-color: var(--accent-hover);
  background: var(--accent);
  color: #100524;
  transform: translateY(-1px);
  box-shadow: 0 0 16px var(--accent-glow);
}

.mod-banner__summary {
  max-width: 44rem;
  margin: 0;
  color: #ded4f2;
  line-height: 1.65;
  font-size: 1.02rem;
}

.mod-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(21rem, 0.85fr);
  gap: 2.2rem;
  margin-top: 2.2rem;
  align-items: start;
}

.mod-introduction {
  padding: 0.5rem 0 1rem;
}

.mod-introduction h2, .download-panel h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.mod-introduction h2::before, .download-panel h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: var(--accent);
}

.long-description {
  color: var(--muted);
  line-height: 1.85;
}

.long-description h1,
.long-description h2,
.long-description h3,
.long-description h4,
.long-description h5,
.long-description h6 {
  margin: 1.8rem 0 0.8rem;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.03em;
  font-weight: 850;
}

.long-description h1 { font-size: 1.85rem; border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }
.long-description h2 { font-size: 1.5rem; }
.long-description h3 { font-size: 1.2rem; }
.long-description h4 { font-size: 1.05rem; }
.long-description h5 { font-size: 0.95rem; }
.long-description h6 { font-size: 0.86rem; }

.long-description p,
.long-description ul,
.long-description ol {
  margin: 0 0 1.1rem;
}

.long-description ul,
.long-description ol {
  padding-left: 1.5rem;
}

.long-description li {
  margin-bottom: 0.4rem;
}

.long-description li:last-child {
  margin-bottom: 0;
}

.long-description blockquote {
  margin: 1.25rem 0;
  border-left: 4px solid var(--accent);
  border-radius: 0;
  padding: 0.6rem 1.15rem;
  background: rgba(169, 132, 255, 0.06);
  color: #ded2f3;
}

.long-description blockquote > :first-child { margin-top: 0; }
.long-description blockquote > :last-child { margin-bottom: 0; }

.long-description blockquote blockquote {
  margin: 0.75rem 0;
  border-left-color: var(--accent-dim);
  background: rgba(0, 0, 0, 0.25);
}

.long-description blockquote h1,
.long-description blockquote h2,
.long-description blockquote h3 {
  margin-top: 0.5rem;
  color: var(--accent-hover);
}

.long-description a {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.long-description a:hover {
  color: #fff;
}

.long-description code {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.12rem 0.4rem;
  background: #181226;
  color: var(--accent-hover);
  font: 0.88em var(--font-mono);
}

.long-description pre {
  margin: 1.25rem 0;
  padding: 1.15rem;
  background: #0e0a18;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0;
  overflow-x: auto;
}

.long-description pre code {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #f6f1ff;
}

.long-description table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.3rem 0;
  font-size: 0.92rem;
  border: 1px solid var(--line);
  border-radius: 0;
}

.long-description th,
.long-description td {
  border: 1px solid var(--line);
  padding: 0.65rem 0.9rem;
  text-align: left;
}

.long-description th {
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.long-description tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.long-description hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.long-description del,
.long-description s {
  color: var(--muted);
  opacity: 0.75;
}

.long-description input[type="checkbox"] {
  margin-right: 0.5rem;
  accent-color: var(--accent);
  border-radius: 0;
}

.long-description img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0;
  margin: 0.75rem 0;
}

/* Download Section */
.download-panel {
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 0;
  background: var(--surface);
  padding: 1.35rem;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.4);
}

.release {
  border-top: 1px solid var(--line);
}

.release summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 1.05rem 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.release summary::-webkit-details-marker {
  display: none;
}

.release summary::before {
  color: var(--accent);
  content: "▶";
  font-size: 0.75rem;
  transition: transform 0.15s;
}

.release[open] summary::before {
  content: "▼";
}

.release__date {
  color: var(--muted);
  font-size: 0.78rem;
}

.release__body {
  padding: 0 0 1.15rem 1.25rem;
}

.release__notes {
  margin: 0.85rem 0;
  color: var(--muted);
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.6;
}

.download-files {
  display: grid;
  gap: 0.65rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.download-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  border-radius: 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-bright);
  padding: 0.85rem 1rem;
  background: var(--surface-raised);
  transition: border-left-color 0.15s, background 0.15s;
}

.download-file:hover {
  border-left-color: var(--accent);
  background: rgba(40, 28, 66, 0.6);
}

.download-file strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.download-file__meta {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font: 0.72rem var(--font-mono);
}

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  color: #100524;
  font-size: 0.84rem;
  font-weight: 900;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  cursor: pointer;
  transition: filter 0.15s, transform 0.12s, box-shadow 0.15s;
}

.download:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 0 18px var(--accent-glow);
}

@media (max-width: 42rem) {
  .site-header, .home, #mod-page, .site-footer {
    width: min(100% - 1.5rem, 76rem);
  }
  .home {
    padding-top: 3rem;
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar input {
    width: 100%;
  }
  .mod-grid {
    grid-template-columns: 1fr;
  }
  .mod-banner {
    min-height: 24rem;
  }
  .mod-banner__content {
    align-items: start;
    flex-direction: column;
    padding: 1.4rem;
  }
  .mod-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .download-file {
    grid-template-columns: 1fr;
  }
  .download {
    text-align: center;
  }
}
