/* WotbMod portal.
   One neutral scale (cool graphite), one accent (cobalt), one radius (8px),
   one family (Onest; JetBrains Mono only for ids and hashes). Depth comes
   from hairlines and spacing, never from shadows, blur or gradients. Dark
   follows the game; light follows the OS when it asks for it. */

@import url("fonts/fonts.css");

:root {
  --bg: #141719;
  --bg-2: #191d21;
  --raised: #20252a;
  --line: rgba(235, 240, 245, 0.09);
  --line-2: rgba(235, 240, 245, 0.17);
  --text: #e7eaed;
  --text-2: #a3acb5;
  --text-3: #6f7983;
  --accent: #6ea2ff;        /* accent as text and outlines */
  --accent-fill: #2f6fe8;   /* accent as a filled control */
  --on-accent: #ffffff;
  --accent-soft: rgba(110, 162, 255, 0.14);
  --danger: #e6756f;
  --danger-fill: #c9463d;
  --radius: 8px;
  --font: "Onest", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --max: 1040px;
  --t: 150ms;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f7;
    --bg-2: #ffffff;
    --raised: #ffffff;
    --line: rgba(20, 25, 30, 0.10);
    --line-2: rgba(20, 25, 30, 0.18);
    --text: #171a1d;
    --text-2: #5c6670;
    --text-3: #8a939c;
    --accent: #2457d6;
    --accent-fill: #2457d6;
    --accent-soft: rgba(36, 87, 214, 0.10);
    --danger: #b5352d;
    --danger-fill: #c9463d;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font: 400 15px/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 18px; margin-bottom: 12px; }
h3 { font-size: 15px; font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: 13px; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- shell ------------------------------------------------------------------ */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: var(--max); margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 20px; }
.brand { font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; color: var(--text); }
.topnav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.topnav a, .topnav button {
  padding: 7px 10px; border-radius: var(--radius); color: var(--text-2); font-weight: 500; font-size: 14px;
  background: none; border: 0; cursor: pointer; font-family: inherit; transition: color var(--t), background var(--t);
}
.topnav a:hover, .topnav button:hover { color: var(--text); background: var(--raised); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--text); }
.topnav .me { display: flex; align-items: center; gap: 2px; margin-left: 8px; padding-left: 10px; border-left: 1px solid var(--line); }
.topsearch { flex: 1; max-width: 360px; }
.topsearch input[type="search"] { width: 100%; height: 36px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; font-size: 14px; }
body.home .topsearch { display: none; }

main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 28px 20px 64px; }
.foot { border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
.foot-inner { max-width: var(--max); margin: 0 auto; padding: 16px 20px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.foot a { color: var(--text-2); }
.foot .spacer { flex: 1; }

/* ---- catalogue --------------------------------------------------------------- */
.page-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; }
.page-head .muted { font-size: 14px; }
.searchrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 12px; }
.searchrow input[type="search"] { height: 42px; padding: 0 14px; font-size: 15px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters .toggle {
  padding: 6px 10px; border-radius: var(--radius); border: 1px solid var(--line); background: transparent;
  color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: color var(--t), background var(--t), border-color var(--t);
}
.filters .toggle:hover { color: var(--text); border-color: var(--line-2); }
.filters .toggle[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.filters select { width: auto; flex: 0 0 auto; margin-left: auto; height: 32px; padding: 0 8px; font-size: 13.5px; }

.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 8px; margin: 0 -8px; border-bottom: 1px solid var(--line); border-radius: var(--radius); transition: background var(--t); }
.row:hover { background: var(--bg-2); }
.row .name { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 15.5px; font-weight: 600; }
.row .name a { color: var(--text); }
.row .sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { text-align: right; color: var(--text-2); font-size: 13px; line-height: 1.5; white-space: nowrap; }
.row .meta b { display: block; color: var(--text); font-weight: 500; }
.mark {
  width: 40px; height: 40px; border-radius: var(--radius); display: grid; place-items: center;
  font-weight: 700; font-size: 14px; letter-spacing: 0; color: var(--accent); background: var(--accent-soft);
}
.mark.lg { width: 56px; height: 56px; font-size: 18px; }
.verified { color: var(--accent); font-size: 12.5px; font-weight: 600; }
.tier-label { color: var(--text-3); font-size: 13px; font-weight: 500; letter-spacing: 0; }
h1 .verified, h1 .tier-label { font-size: 13px; }
.empty { padding: 40px 0; color: var(--text-2); }

/* ---- mod page ----------------------------------------------------------------- */
.mod-head { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: center; margin-bottom: 28px; }
.mod-head h1 { font-size: 30px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mod-head .by { color: var(--text-2); margin-top: 4px; font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; }
.mod-head .by code { color: var(--text-3); }
.mod-layout { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 40px; align-items: start; }
.panel { position: sticky; top: 76px; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px; background: var(--bg-2); }
.panel .ver { color: var(--text-2); font-size: 13.5px; margin-bottom: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid var(--line-2); background: transparent; color: var(--text);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t);
}
.btn:hover { background: var(--raised); text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { width: 100%; height: 44px; font-size: 15px; color: var(--on-accent); background: var(--accent-fill); border-color: var(--accent-fill); }
.btn-primary:hover { color: var(--on-accent); background: #2a63d1; border-color: #2a63d1; }
.btn-primary[aria-busy="true"] { pointer-events: none; opacity: 0.75; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13.5px; }
.btn-ghost { border-color: transparent; color: var(--text-2); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { color: var(--on-accent); background: var(--danger-fill); border-color: var(--danger-fill); }
.panel .alt { display: flex; gap: 14px; margin: 12px 0 4px; font-size: 13.5px; }
.facts { margin: 14px 0 0; padding: 0; list-style: none; }
.facts li { display: grid; grid-template-columns: 104px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.facts li b { font-weight: 500; color: var(--text-2); }
.facts code { word-break: break-all; }
.copy { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12.5px; padding: 0; margin-left: 6px; }
.copy:hover { text-decoration: underline; }
.deps a { color: var(--accent); }

.section { margin-top: 32px; }
.perm-groups { display: grid; gap: 12px; }
.perm-group { display: grid; grid-template-columns: 200px 1fr; gap: 14px; align-items: baseline; font-size: 14px; }
.perm-group .k { color: var(--text); font-weight: 600; }
.perm-group .k span { display: block; color: var(--text-3); font-size: 12.5px; font-weight: 400; line-height: 1.4; margin-top: 2px; }
.perm-group code { color: var(--text); line-height: 1.7; }

.versions { list-style: none; margin: 0; padding: 0; }
.versions li { padding: 12px 0; border-top: 1px solid var(--line); }
.versions .vh { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.versions .vh b { font-size: 15px; }
.versions .vh span { color: var(--text-2); }
.versions p { margin: 4px 0 0; font-size: 14px; max-width: 68ch; }

.scan { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.scan.high { border-color: var(--danger); }
.scan ul { margin: 8px 0 0; padding-left: 1.1em; color: var(--text-2); font-size: 13.5px; }

.comments { list-style: none; margin: 0; padding: 0; }
.comments li { padding: 12px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.comments .who { color: var(--text-2); font-size: 13px; margin-bottom: 3px; }
.rating-pick { display: inline-flex; gap: 4px; }
.rating-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.rating-pick label { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2); transition: background var(--t), color var(--t), border-color var(--t); }
.rating-pick label:hover { color: var(--text); border-color: var(--text-2); }
.rating-pick input:checked + label { color: var(--on-accent); background: var(--accent-fill); border-color: var(--accent-fill); }

/* ---- forms ------------------------------------------------------------------- */
form { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13.5px; color: var(--text-2); font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], textarea, select, input[type="file"] {
  width: 100%; padding: 9px 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--bg-2);
  color: var(--text); font: inherit; font-size: 14.5px; transition: border-color var(--t);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.check input { width: 15px; height: 15px; accent-color: var(--accent-fill); }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline input, .inline select { width: auto; flex: 1; min-width: 150px; }
.auth { max-width: 400px; margin: 36px auto; }
.auth h1 { font-size: 24px; margin-bottom: 16px; }
.auth .after { margin-top: 14px; color: var(--text-2); font-size: 14px; }

/* ---- lists (dashboard, moderation, compat) -------------------------------------- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 14px; }
.rows .grow { flex: 1; min-width: 200px; }
.rows .sub { color: var(--text-2); font-size: 13px; }
.rows form { display: inline; }
.status { font-size: 12.5px; color: var(--text-2); }
.status.published { color: var(--accent); }
.status.unpublished { color: var(--danger); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.notice { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 14px; }
.notice.warn { border-color: var(--danger); }
details { border-top: 1px solid var(--line); padding: 10px 0; }
details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 8px; }
.prose { max-width: 68ch; }
.prose h2 { margin-top: 26px; }
.prose li { margin-bottom: 6px; }
.token { padding: 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); word-break: break-all; }

/* ---- toast ----------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; z-index: 50;
  padding: 10px 14px; border-radius: var(--radius); background: var(--raised); border: 1px solid var(--line-2);
  color: var(--text); font-size: 14px; transition: transform 200ms, opacity 200ms; max-width: min(92vw, 520px);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { border-color: var(--danger); }

/* ---- motion: one fade on arrival, answers to actions, nothing on loop ----------- */
@keyframes arrive { from { opacity: 0; } to { opacity: 1; } }
main { animation: arrive 220ms ease-out both; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 140ms; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: var(--on-accent); animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- responsive ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .mod-layout { grid-template-columns: 1fr; }
  .panel { position: static; }
  .two { grid-template-columns: 1fr; }
  .topsearch { display: none; }
}
@media (max-width: 600px) {
  .row { grid-template-columns: 40px minmax(0, 1fr); }
  .row .meta { grid-column: 2; text-align: left; white-space: normal; }
  .row .meta b { display: inline; margin-right: 8px; }
  .perm-group { grid-template-columns: 1fr; gap: 4px; }
  .facts li { grid-template-columns: 1fr; gap: 2px; }
  .searchrow { grid-template-columns: 1fr; }
  .topnav a, .topnav button { padding: 7px 7px; font-size: 13.5px; }
}

/* the install bundle list on /download */
.table-wrap { overflow-x: auto; margin: 8px 0 16px; }
table.downloads { width: 100%; border-collapse: collapse; font-size: 14px; }
table.downloads th, table.downloads td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.downloads th { font-weight: 500; color: var(--muted); }
table.downloads code { font-size: 12px; word-break: break-all; }
