/* Tiny Strats changelog. Hand-written; index.html is generated by build.mjs.
   Shares its look with the Tiny Strats 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;
  --target: #fff6d6;
  --mark: #fde68a;
  --shadow: 0 1px 2px rgb(20 24 28 / 0.05), 0 6px 24px rgb(20 24 28 / 0.08);
  /* change kinds: text / soft background */
  --added: #23764d;   --added-bg: #e3f3ea;
  --changed: #2259a8; --changed-bg: #e6eefb;
  --balance: #8a5a00; --balance-bg: #fbf0d9;
  --fixed: #7a3fb0;   --fixed-bg: #f1e8fa;
  --removed: #b03a2e; --removed-bg: #fbe8e5;
  --perf: #0f7486;    --perf-bg: #e0f3f6;
  --other: #5d6570;   --other-bg: #eeeeea;
  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;
    --target: #33300f;
    --mark: #5c4a0f;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 28px rgb(0 0 0 / 0.4);
    --added: #7fd8a8;   --added-bg: #173025;
    --changed: #82b4ff; --changed-bg: #182638;
    --balance: #f0c674; --balance-bg: #322914;
    --fixed: #c9a2f2;   --fixed-bg: #2a1f38;
    --removed: #f4958a; --removed-bg: #3a1e1b;
    --perf: #6fd3e3;    --perf-bg: #133038;
    --other: #a0a8b1;   --other-bg: #22262c;
    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;
  --target: #33300f;
  --mark: #5c4a0f;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 28px rgb(0 0 0 / 0.4);
  --added: #7fd8a8;   --added-bg: #173025;
  --changed: #82b4ff; --changed-bg: #182638;
  --balance: #f0c674; --balance-bg: #322914;
  --fixed: #c9a2f2;   --fixed-bg: #2a1f38;
  --removed: #f4958a; --removed-bg: #3a1e1b;
  --perf: #6fd3e3;    --perf-bg: #133038;
  --other: #a0a8b1;   --other-bg: #22262c;
  color-scheme: dark;
}

.k-added { --k: var(--added); --k-bg: var(--added-bg); }
.k-changed { --k: var(--changed); --k-bg: var(--changed-bg); }
.k-balance { --k: var(--balance); --k-bg: var(--balance-bg); }
.k-fixed { --k: var(--fixed); --k-bg: var(--fixed-bg); }
.k-removed, .k-security { --k: var(--removed); --k-bg: var(--removed-bg); }
.k-performance { --k: var(--perf); --k-bg: var(--perf-bg); }
.k-other { --k: var(--other); --k-bg: var(--other-bg); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
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; }
[id] { scroll-margin-top: 76px; }
.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; white-space: nowrap; width: 236px; flex: none; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 700; }
.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);
}
.search { position: relative; flex: 1; max-width: 520px; }
.search input {
  width: 100%; height: 36px; padding: 0 40px 0 36px;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a929c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") 12px 50% no-repeat;
  border: 1px solid var(--line-strong); border-radius: 9px;
  -webkit-appearance: none; appearance: none;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font: 12px/1 ui-monospace, monospace; color: var(--faint);
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 3px 6px; pointer-events: none;
}
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }

.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, .menu {
  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;
}
.links:empty + .theme { margin-left: auto; }
.theme::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(90deg, var(--text) 50%, transparent 50%);
  border: 2px solid var(--text);
}
.menu { display: none; }
.menu span, .menu span::before, .menu span::after {
  display: block; width: 16px; height: 2px; background: currentColor; border-radius: 1px; position: relative;
}
.menu span::before, .menu span::after { content: ""; position: absolute; left: 0; }
.menu span::before { top: -5px; }
.menu span::after { top: 5px; }

/* ---------------------------------------------------------------- layout */

.layout { display: grid; grid-template-columns: 276px minmax(0, 1fr); max-width: 1240px; }
nav.side {
  position: sticky; top: 58px; align-self: start;
  height: calc(100vh - 58px); overflow-y: auto; overscroll-behavior: contain;
  padding: 22px 16px 40px 20px;
}
.side-h {
  margin: 0 0 6px; padding: 0 10px;
  font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
}
nav.side a.rel {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 6px 10px; margin: 1px 0; border-radius: 7px; color: var(--text); font-size: 15px; font-weight: 500;
}
nav.side a.rel .v { font-variant-numeric: tabular-nums; }
nav.side a.rel small { color: var(--faint); font-size: 12.5px; font-weight: 400; white-space: nowrap; }
nav.side a.rel:hover { background: var(--code-bg); text-decoration: none; }
nav.side a.rel.active { background: var(--accent-soft); color: var(--link); font-weight: 650; }
nav.side a.rel.empty { opacity: .45; }
nav.side .toc { display: none; margin: 4px 0 10px 12px; padding-left: 10px; border-left: 1px solid var(--line-strong); }
nav.side a.rel.active + .toc { display: block; }
nav.side .toc a {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 3px 8px; margin-left: -11px; border-left: 2px solid transparent;
  color: var(--muted); font-size: 14px; line-height: 1.45;
}
nav.side .toc a span { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
nav.side .toc a:hover { color: var(--text); text-decoration: none; }
nav.side .toc a.active { color: var(--k); border-left-color: var(--k); }

.side-links { display: none; margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.side-links a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--muted); font-size: 15px; }
.side-links a:hover { background: var(--code-bg); color: var(--text); text-decoration: none; }

main { padding: 40px 48px 64px; max-width: 880px; min-width: 0; }

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

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; position: relative; }
h1 { font-size: 34px; margin: 0 0 10px; letter-spacing: -0.02em; }
p.lead { font-size: 18.5px; line-height: 1.6; color: var(--muted); margin: 0 0 22px; max-width: 46em; }
p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 24px; }
li { margin: 5px 0; }
li > ul { margin: 4px 0 0; }
strong { font-weight: 650; }
code, kbd { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; }
code { font-size: 0.86em; background: var(--code-bg); padding: 0.12em 0.38em; border-radius: 5px; overflow-wrap: break-word; }
a code { color: inherit; }
mark { background: var(--mark); color: inherit; border-radius: 2px; }
figure { margin: 18px 0 22px; }
figure img, li img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); display: block; }
li img { margin: 8px 0; }

/* filter chips */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--muted);
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line-strong);
  transition: border-color .12s, background .12s, color .12s;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--k, var(--accent)); }
.chip[data-kind=""]::before { display: none; }
.chip span { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--k, var(--accent)); color: var(--text); }
.chip[aria-pressed="true"] { color: var(--k, var(--link)); background: var(--k-bg, var(--accent-soft)); border-color: var(--k, var(--accent)); font-weight: 600; }
.chip[aria-pressed="true"] span { color: inherit; opacity: .75; }
.status { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.status button, .none button {
  font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; margin-left: 6px;
}
.status button:hover, .none button:hover { text-decoration: underline; }
.none { margin: 40px 0; padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 12px; }

/* releases */
.release { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.release-head { margin-bottom: 18px; }
.release h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 6px; font-size: 26px; }
.release h2 .ver { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.release h2 .rtitle { font-weight: 600; color: var(--muted); font-size: 0.8em; }
.anchor {
  position: absolute; left: -0.9em; width: 0.9em; color: var(--faint); opacity: 0; font-weight: 400;
  text-decoration: none !important;
}
h2:hover .anchor, .anchor:focus { opacity: 1; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; color: var(--muted); font-size: 14.5px; }
.meta .count { color: var(--faint); }
.meta .count::before { content: "·"; margin-right: 12px; }
.badge {
  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;
}
.badge + .count::before { content: none; }
.summary { font-size: 16.5px; }
.summary p { max-width: 46em; }

.cat { margin: 26px 0 10px; }
.cat h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 15px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--k); background: var(--k-bg); padding: 4px 10px; border-radius: 6px;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cat h3 .n { color: var(--faint); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cat h4 { font-size: 16.5px; margin: 20px 0 6px; }
.group:first-of-type h4, h3 + .group h4 { margin-top: 12px; }

ul.changes {
  list-style: none; padding: 0; margin: 0 0 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
ul.changes > li {
  position: relative; margin: 0; padding: 10px 16px 10px 30px; border-bottom: 1px solid var(--line);
  font-size: 15.5px; line-height: 1.6;
}
ul.changes > li:last-child { border-bottom: 0; }
ul.changes > li::before {
  content: ""; position: absolute; left: 14px; top: 1.15em; width: 6px; height: 6px; border-radius: 50%; background: var(--k, var(--accent));
}
ul.changes > li:target, ul.changes > li.flash { background: var(--target); }
ul.changes li ul { padding-left: 20px; color: var(--muted); font-size: 15px; }
ul.changes li ul li { margin: 2px 0; }
ul.changes li ul li::marker { color: var(--faint); }

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

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

@media (max-width: 900px) {
  .top { padding: 0 12px; gap: 10px; }
  .menu { display: grid; }
  .brand { width: auto; }
  .brand b { display: none; }
  .links { display: none; }
  .side-links { display: block; }
  .theme { margin-left: auto; }
  .layout { display: block; }
  nav.side {
    position: fixed; top: 58px; left: 0; bottom: 0; z-index: 15; width: min(300px, 85vw); height: auto; align-self: auto;
    background: var(--panel); border-right: 1px solid var(--line); box-shadow: var(--shadow);
    transform: translateX(-102%); transition: transform .18s ease-out; visibility: hidden;
  }
  body.nav-open nav.side { transform: none; visibility: visible; }
  body.nav-open::after { content: ""; position: fixed; inset: 58px 0 0; z-index: 10; background: rgb(0 0 0 / 0.25); }
  main { padding: 28px 16px 56px; }
  h1 { font-size: 28px; }
  .release h2 { font-size: 22px; }
  p.lead { font-size: 17px; }
  .anchor { display: none; }
  ul.changes > li { padding: 9px 12px 9px 26px; font-size: 15px; }
  ul.changes > li::before { left: 11px; }
}
@media (max-width: 520px) {
  .search kbd { display: none; }
  .brand { display: none; }
}
