:root {
  color-scheme: light dark;

  --bg: light-dark(#ffffff, #111211);
  --surface: light-dark(#f5f5f4, #1b1c1b);
  --surface-2: light-dark(#ebebe9, #262826);
  --text: light-dark(#1a1a19, #ecedea);
  --muted: light-dark(#63635f, #a0a19c);
  --line: light-dark(#e4e4e1, #2a2c2a);
  --accent: light-dark(#2f9e44, #4cc264);
  --accent-text: light-dark(#23773a, #4cc264);
  --warn: light-dark(#b45309, #e0a050);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --sun: block;
  --moon: none;

  &:has(> head > meta[name="color-scheme"][content="dark"]) { color-scheme: dark; --sun: none; --moon: block; }
  &:has(> head > meta[name="color-scheme"][content="light"]) { color-scheme: light; --sun: block; --moon: none; }
}
@media (prefers-color-scheme: dark) {
  :root:has(> head > meta[name="color-scheme"][content="light dark"]) { --sun: none; --moon: block; }
}

*, *::before, *::after { box-sizing: border-box; }
html { accent-color: var(--accent); scrollbar-color: var(--surface-2) var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.site-header {
  max-width: 40rem; margin: 0 auto; padding: 1.5rem 1.25rem 0;
  display: flex; justify-content: space-between; align-items: center;
}
nav { display: flex; gap: 1.25rem; }
nav a { color: var(--muted); text-decoration: none; padding: 0.25rem 0; transition: color 0.15s; }
nav a:hover { color: var(--text); }
nav a[aria-current="page"] { color: var(--text); font-weight: 500; }

.theme-toggle {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; margin-right: -0.5rem;
  background: none; border: 0; border-radius: 0.5rem; color: var(--muted); cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.theme-toggle:hover { color: var(--text); background: var(--surface); }
.icon-sun { display: var(--sun); }
.icon-moon { display: var(--moon); }

main { max-width: 40rem; margin: 0 auto; padding: 3.5rem 1.25rem 5rem; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; margin: 0; text-wrap: balance; }
h2 { font-size: 1rem; font-weight: 600; margin: 0 0 0.75rem; }
.lede { color: var(--muted); margin: 0.5rem 0 0; }

.btn, .dl, .src {
  display: inline-block; padding: 0.35rem 0; font: inherit; font-weight: 500; text-decoration: underline;
  text-decoration-color: transparent; text-underline-offset: 0.25em; text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s, color 0.15s;
}
.dl { color: var(--text); }
.src { color: var(--muted); font-weight: 400; }
.dl:hover, .src:hover { text-decoration-color: currentColor; }
.src:hover { color: var(--text); }
.links { display: flex; align-items: center; gap: 1.25rem; }

.bundle { margin-top: 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.bundle p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.bundle[hidden] { display: none; }

.mod-list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.mod { background: var(--surface); border-radius: 0.375rem; padding: 1.25rem; display: grid; gap: 0.25rem; }
.mod-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.mod h2 { margin: 0; font-size: 1.0625rem; }
.tag { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.tag-new { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--accent-text); letter-spacing: 0.04em; text-transform: uppercase; }
.tag-new::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--accent); }
.mod p { margin: 0; color: var(--muted); max-width: 60ch; }
.mod-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.9rem; flex-wrap: wrap; }
.meta { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.empty { color: var(--muted); }
.error { color: var(--warn); }

/* Server-Info */
.icon-btn {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; margin: -0.5rem;
  background: none; border: 0; border-radius: 0.375rem; color: var(--muted); cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn .i-check { display: none; }
.icon-btn[data-state="done"] { color: var(--accent-text); }
.icon-btn[data-state="done"] .i-copy { display: none; }
.icon-btn[data-state="done"] .i-check { display: block; }
.icon-btn[data-state="failed"] { color: var(--warn); }
.status { margin-top: 2rem; background: var(--surface); border-radius: 0.375rem; padding: 1.25rem; display: grid; gap: 1rem; }
.status-line { margin: 0; display: flex; align-items: center; gap: 0.6rem; font-weight: 500; }
.dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--muted); flex: none; }
.dot[data-state="online"] { background: var(--accent); }
.dot[data-state="offline"] { background: var(--warn); }
.address { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.address code { font-family: var(--mono); font-size: 1rem; overflow-wrap: anywhere; user-select: all; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.facts dt { font-size: 0.8125rem; color: var(--muted); }
.facts dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }

section + section { margin-top: 2.5rem; }
#required-section { margin-top: 2.5rem; }
.mods-table { width: 100%; border-collapse: collapse; }
.mods-table th { text-align: left; font-size: 0.8125rem; font-weight: 400; color: var(--muted); padding: 0 0 0.5rem; border-bottom: 1px solid var(--line); }
.mods-table td { padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.mods-table th:last-child, .mods-table td:last-child { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mods-table th:last-child { font-family: var(--font); }
.mods-table td:last-child { color: var(--muted); font-size: 0.9375rem; }

@media (prefers-reduced-motion: no-preference) {
  .mod { animation: rise 0.45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
  @keyframes rise { from { opacity: 0; translate: 0 6px; } }
}
@media (max-width: 30rem) {
  main { padding-top: 2.5rem; }
}
