/* bitterious.me router page. Hand-written; shares its look with the Tiny Strats changelog and modding docs. */

:root {
  --bg: #f7f7f4;
  --panel: #ffffff;
  --raised: #fbfbf9;
  --text: #1d2126;
  --muted: #5d6570;
  --faint: #8a929c;
  --line: #e4e4de;
  --line-strong: #d3d3cb;
  --accent: #2f6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #e5f1ea;
  --link: #22684a;
  --code-bg: #f0f0eb;
  --shadow: 0 1px 2px rgb(20 24 28 / 0.05), 0 6px 24px rgb(20 24 28 / 0.08);
  --log: #2259a8;  --log-bg: #e6eefb;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121417;
    --panel: #181b1f;
    --raised: #1c2025;
    --text: #e4e7ea;
    --muted: #a0a8b1;
    --faint: #737c86;
    --line: #272b31;
    --line-strong: #343a41;
    --accent: #6fcf9c;
    --accent-ink: #0d1a13;
    --accent-soft: #19302a;
    --link: #7fd8a8;
    --code-bg: #22262c;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 28px rgb(0 0 0 / 0.4);
    --log: #82b4ff;  --log-bg: #182638;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121417;
  --panel: #181b1f;
  --raised: #1c2025;
  --text: #e4e7ea;
  --muted: #a0a8b1;
  --faint: #737c86;
  --line: #272b31;
  --line-strong: #343a41;
  --accent: #6fcf9c;
  --accent-ink: #0d1a13;
  --accent-soft: #19302a;
  --link: #7fd8a8;
  --code-bg: #22262c;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 28px rgb(0 0 0 / 0.4);
  --log: #82b4ff;  --log-bg: #182638;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--panel); padding: 6px 10px; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- top bar */

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  height: 58px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 16px; font-weight: 700; white-space: nowrap; flex: none; }
.brand:hover { text-decoration: none; }
.logo {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  background:
    linear-gradient(var(--accent), var(--accent)) 3px 3px / 7px 7px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 12px 12px / 7px 7px no-repeat,
    linear-gradient(color-mix(in srgb, var(--accent) 45%, transparent), color-mix(in srgb, var(--accent) 45%, transparent)) 12px 3px / 7px 7px no-repeat,
    var(--accent-soft);
}
.links { display: flex; gap: 4px; margin-left: auto; }
.links a { padding: 6px 10px; border-radius: 7px; color: var(--muted); font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.links a:hover { color: var(--text); background: var(--code-bg); text-decoration: none; }
.theme {
  flex: none; width: 36px; height: 36px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
  display: grid; place-items: center; padding: 0;
}
.theme::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(90deg, var(--text) 50%, transparent 50%);
  border: 2px solid var(--text);
}

/* ---------------------------------------------------------------- content */

main { padding: 64px 24px 64px; max-width: 880px; margin: 0 auto; }
h1, h2 { line-height: 1.25; }
h1 { font-size: 40px; margin: 0 0 10px; letter-spacing: -0.025em; }
h2 {
  margin: 52px 0 12px; padding-top: 22px; border-top: 1px solid var(--line);
  font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
}
p.lead { font-size: 18.5px; line-height: 1.6; color: var(--muted); margin: 0 0 32px; max-width: 46em; }
code { font: 0.86em ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; background: var(--code-bg); padding: 0.12em 0.38em; border-radius: 5px; }

/* route cards */
.routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.route {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 22px 22px 20px; border-radius: 14px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line);
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.route:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .route, .route:hover { transition: none; transform: none; } }
.route .body { flex: 1; min-width: 0; }
.route strong { display: block; margin-bottom: 4px; font-size: 19px; letter-spacing: -0.01em; }
.route .body > span { display: block; color: var(--muted); font-size: 15px; line-height: 1.55; }
.route .go { color: var(--faint); font-size: 20px; line-height: 1.3; transition: color .12s, transform .12s; }
.route:hover .go { color: var(--link); transform: translateX(3px); }

.icon { flex: none; width: 44px; height: 44px; border-radius: 11px; position: relative; }
/* changelog: a list of coloured change dots */
.icon-log {
  background:
    radial-gradient(circle, var(--log) 3px, transparent 3.5px) 10px 9px / 8px 8px no-repeat,
    linear-gradient(var(--log), var(--log)) 21px 12px / 14px 2px no-repeat,
    radial-gradient(circle, var(--log) 3px, transparent 3.5px) 10px 18px / 8px 8px no-repeat,
    linear-gradient(var(--log), var(--log)) 21px 21px / 10px 2px no-repeat,
    radial-gradient(circle, var(--log) 3px, transparent 3.5px) 10px 27px / 8px 8px no-repeat,
    linear-gradient(var(--log), var(--log)) 21px 30px / 13px 2px no-repeat,
    var(--log-bg);
}
/* modding docs: code brackets */
.icon-docs { background: var(--accent-soft); }
.icon-docs::before {
  content: "{ }"; position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 17px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--link); letter-spacing: -0.05em;
}

.route .latest {
  display: inline-flex !important; align-items: center; gap: 8px; margin-top: 12px;
  font-size: 13px !important; color: var(--muted);
}
.route .latest b {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent); padding: 3px 8px; border-radius: 5px;
}
.route .tags { display: flex !important; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.route .tags code { font-size: 12.5px; color: var(--muted); }

/* 404 */
.code404 {
  margin: 0 0 4px; font: 700 15px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .12em; color: var(--link);
}
.lead code { color: var(--text); overflow-wrap: anywhere; }
.routes.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.routes.three .route { flex-direction: column; gap: 14px; position: relative; }
.routes.three .go { position: absolute; top: 22px; right: 22px; }
.route.suggested { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.icon-home {
  background:
    linear-gradient(var(--accent), var(--accent)) 15px 21px / 14px 11px no-repeat,
    var(--accent-soft);
}
.icon-home::before {
  content: ""; position: absolute; left: 12px; top: 11px;
  border: 10px solid transparent; border-bottom-color: var(--accent); border-top: 0;
}

/* quick links */
ul.quick {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px;
}
ul.quick a {
  display: block; padding: 9px 14px; border-radius: 9px; font-size: 15px; font-weight: 500;
  color: var(--text); background: var(--panel); border: 1px solid var(--line);
}
ul.quick a:hover { border-color: var(--accent); color: var(--link); text-decoration: none; }

footer { color: var(--faint); font-size: 13px; margin-top: 56px; }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 640px) {
  .top { padding: 0 12px; gap: 10px; }
  .links a { padding: 6px 8px; font-size: 14px; }
  main { padding: 36px 16px 56px; }
  h1 { font-size: 30px; }
  p.lead { font-size: 17px; }
  .routes { grid-template-columns: 1fr; }
  .route { padding: 18px 16px; gap: 14px; }
  .routes.three .route { flex-direction: row; }
  .routes.three .go { position: static; }
  .icon { width: 38px; height: 38px; transform: scale(.87); transform-origin: top left; margin-right: -5px; }
}
@media (max-width: 380px) {
  .links { display: none; }
  .theme { margin-left: auto; }
}
