/* Open Release Index - self-hosted stylesheet. No web fonts, no remote assets. */

:root {
  color-scheme: light dark;

  /* Colour */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-muted: #eef1f5;
  --text: #16191d;
  --text-muted: #525a66;
  --border: #d3d9e2;
  --border-strong: #9aa4b2;
  --accent: #0b6b6f;
  --accent-contrast: #ffffff;
  --code-bg: #eceff4;
  --mark: #b45309;

  /* Layout and spacing tokens. Every block on a page uses the same container,
     inner padding, and vertical rhythm so left/right edges stay aligned. */
  --content-max: 72rem;
  --gutter: 1.5rem;
  --pad-block: 1.25rem;
  --measure: 68ch;
  --measure-tight: 58ch;
  --radius: 8px;
  --gap-3xs: 0.2rem;
  --gap-2xs: 0.4rem;
  --gap-xs: 0.65rem;
  --gap-sm: 1rem;
  --gap-md: 1.5rem;
  --gap-lg: 2rem;
  --gap-xl: 2.75rem;
  --line: 1.6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317;
    --surface: #171b21;
    --surface-muted: #1d222a;
    --text: #e6e9ee;
    --text-muted: #a6afbc;
    --border: #2b323c;
    --border-strong: #59616e;
    --accent: #6fd3d0;
    --accent-contrast: #06232a;
    --code-bg: #1c222a;
    --mark: #f0b357;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: var(--line);
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

body,
input,
button,
select {
  font-family: inherit;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.6rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 0 0 var(--radius) 0;
  z-index: 10;
}

.skip-link:focus {
  left: 0;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* One shared container. Horizontal padding lives on the container, not on
   individual blocks, so page heads, panels, grids, and the footer align. */
.wrap {
  width: min(100% - (2 * var(--gutter)), var(--content-max));
  margin-inline: auto;
}

main {
  padding-block: var(--gap-xl) calc(var(--gap-xl) + 0.5rem);
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap-2xs) 0.85rem;
  padding-block: 1.05rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  font-size: 1.06rem;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  grid-template-columns: repeat(3, 5px);
  align-content: center;
  justify-content: center;
  gap: 3px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-muted);
}

.brand-mark span {
  block-size: 5px;
  background: var(--accent);
  border-radius: 1px;
}

.brand-mark span:nth-child(2) {
  opacity: 0.72;
}

.brand-mark span:nth-child(4) {
  opacity: 0.55;
}

.brand-mark span:nth-child(5) {
  opacity: 0.4;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  margin-inline-start: 0;
  font-size: 0.94rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding-block: 0.15rem;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--text);
  border-bottom-color: var(--border-strong);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Page head: full container width; the h1 keeps a readable measure on the
   same left baseline. Nothing is centred, so edges never drift. */
.page-head {
  width: 100%;
  margin: 0 0 var(--gap-lg);
}

.page-head > h1 {
  max-width: var(--measure);
}

.eyebrow {
  margin: 0 0 var(--gap-2xs);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.7rem, 1.25rem + 1.7vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0 0 var(--gap-xs);
  font-size: 1.18rem;
  line-height: 1.3;
}

h3 {
  margin: 0 0 var(--gap-2xs);
  font-size: 1rem;
}

p {
  margin: 0 0 var(--gap-sm);
  max-width: none;
}

.lede {
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0 0 var(--gap-sm);
  max-width: none;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.section {
  margin: 0 0 var(--gap-xl);
}

.section:last-child {
  margin-bottom: 0;
}

.section > h2 + p,
.section > h2 + .grid,
.section > h2 + pre,
.section > h2 + ul {
  margin-top: var(--gap-xs);
}

.section > h2 + p {
  margin-top: var(--gap-xs);
}

.grid {
  display: grid;
  gap: var(--gap-sm);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad-block);
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.card h3 {
  color: var(--text);
}

.card p,
.card li {
  color: var(--text-muted);
  font-size: 0.95rem;
}

ul.plain {
  margin: 0 0 var(--gap-sm);
  padding-left: 1.15rem;
  max-width: var(--measure);
}

ul.plain li {
  margin-bottom: 0.4rem;
}

ul.plain li:last-child {
  margin-bottom: 0;
}

code,
kbd,
samp {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

code {
  background: var(--code-bg);
  border-radius: 3px;
  padding: 0.1em 0.34em;
  overflow-wrap: anywhere;
}

pre {
  margin: 0 0 var(--gap-sm);
  padding: 0.95rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.87rem;
  line-height: 1.55;
}

pre code {
  background: none;
  padding: 0;
  font-size: 1em;
}

/* Metadata table and the GitHub description box are separate blocks with an
   explicit section gap; they must never touch. */
.facts {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(9rem, max-content) minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 0.62rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
}

.facts dt {
  color: var(--text-muted);
  background: var(--surface-muted);
  font-weight: 550;
}

.facts dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.facts dt:last-of-type,
.facts dd:last-of-type {
  border-bottom: 0;
}

.facts + .notice,
.facts + p,
.facts + .small {
  margin-top: var(--gap-md);
}

.notice {
  width: 100%;
  max-width: none;
  border: 1px solid var(--border);
  border-left: 3px solid var(--mark);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--pad-block);
  margin: 0 0 var(--gap-md);
}

/* A callout uses the full usable width of its own box (minus padding). */
.notice p,
.notice ul,
.notice ol {
  max-width: none;
}

.notice p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.notice p + p {
  margin-top: var(--gap-xs);
}

.notice strong {
  color: var(--text);
}

[hidden] {
  display: none !important;
}

.spaced {
  margin-top: var(--gap-md);
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.88rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: var(--gap-lg);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap-xs) var(--gap-lg);
  align-items: start;
}

.site-footer p {
  margin: 0;
}

/* 404: left-aligned inside the shared container, never centred. */
.centered {
  max-width: none;
  margin: 0;
  padding-block: var(--gap-md);
  text-align: left;
}

.centered h1 {
  font-size: clamp(2.6rem, 2rem + 3vw, 4rem);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Project index */

.filter-panel {
  width: 100%;
  margin: 0 0 var(--gap-lg);
  padding: var(--pad-block);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-panel h2 {
  margin-bottom: var(--gap-2xs);
}

.filter-panel > .small {
  margin-bottom: var(--gap-sm);
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--gap-sm);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
}

.filter-field label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text-muted);
}

.filter-field input,
.filter-field select {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.5rem 0.62rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  font-size: 0.95rem;
}

.filter-field input::placeholder {
  color: var(--text-muted);
}

.filter-field input:hover,
.filter-field select:hover {
  border-color: var(--accent);
}

.filter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: 0.1rem;
}

.filter-reset {
  min-height: 2.55rem;
  padding: 0.45rem 0.9rem;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-reset:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-status {
  margin: var(--gap-xs) 0 0;
  max-width: none;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.project-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--gap-sm);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad-block);
}

.project-card:hover {
  border-color: var(--border-strong);
}

.project-card:focus-within {
  border-color: var(--accent);
}

.project-card h3 {
  margin: 0 0 var(--gap-2xs);
  font-size: 1.05rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.project-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.project-card h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.card-category {
  display: inline-block;
  align-self: flex-start;
  margin: 0 0 var(--gap-2xs);
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card-summary {
  margin: 0 0 var(--gap-xs);
  color: var(--text-muted);
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.card-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: auto 0 var(--gap-xs);
  padding: 0.65rem 0;
  border-block: 1px solid var(--border);
}

.card-facts div {
  min-width: 0;
}

.card-facts dt {
  margin: 0 0 0.1rem;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card-facts dd {
  margin: 0;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2xs) 1rem;
  margin: 0;
  font-size: 0.9rem;
}

.detail-grid {
  display: grid;
  gap: 0 var(--gap-lg);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.detail-grid .section {
  margin-bottom: var(--gap-lg);
}

.project-links li {
  margin-bottom: var(--gap-xs);
}

.project-links .small {
  display: inline-block;
  margin-left: 0.35rem;
}

.project-links a {
  overflow-wrap: anywhere;
}

/* The single download entry point on a detail page. It is a plain external
   link to the project's GitHub Releases page, styled as a clear button. */
.download-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-weight: 650;
  text-decoration: none;
}

.download-link:hover,
.download-link:focus-visible {
  text-decoration: none;
  filter: brightness(1.08);
}

/* The download block is separate from the repository/README link list and sits
   directly above the back link at the end of the page. */
.download-section {
  margin: 0 0 var(--gap-xl);
  padding-top: var(--gap-md);
  border-top: 1px solid var(--border);
}

.back-link {
  margin: 0;
  max-width: none;
}

.external span[aria-hidden="true"] {
  display: inline-block;
  font-size: 0.9em;
  text-decoration: none;
}

@media (max-width: 52rem) {
  :root {
    --gutter: 1.25rem;
  }
}

@media (max-width: 40rem) {
  :root {
    --gutter: 0.9rem;
    --pad-block: 1rem;
    --gap-xl: 2.1rem;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    padding-bottom: 0;
  }

  .filter-reset {
    width: 100%;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .facts dt {
    padding-bottom: 0.1rem;
    border-bottom: 0;
  }

  .facts dd {
    padding-top: 0;
  }

  .facts dd + dt {
    border-top: 1px solid var(--border);
    padding-top: 0.62rem;
  }
}

@media (max-width: 26rem) {
  .card-facts {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-nav {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }
}
