/* the chamesle website */
:root {
  --bg: #ffffff;
  --alt: #f5f6f8;
  --text: #1a1f2b;
  --muted: #5d6677;
  --line: #e3e6eb;
  --blue: #1f5fc4;
  --blue-dark: #174c9f;
  --code: #eef0f3;
  --hero: #0f1a2e;
  --hero-text: #e8edf6;
  --hero-muted: #a9b6cc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --alt: #181c24;
    --text: #e4e7ec;
    --muted: #9aa3b2;
    --line: #262b35;
    --blue: #5e9bff;
    --blue-dark: #4a86ea;
    --code: #1e232c;
    --hero: #0b1220;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 Inter, "Noto Sans", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--blue); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
main { max-width: 760px; margin: 0 auto; padding: 0 24px; }
main.home { max-width: none; padding: 0; }

/* header */
header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
  text-decoration: none;
}
.brand img { width: 32px; height: 32px; }
header.site nav { display: flex; gap: 22px; flex: 1; }
header.site nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
header.site nav a:hover, header.site nav a.here { color: var(--text); }
header.site .button { padding: 7px 16px; font-size: 15px; }
@media (max-width: 860px) {
  header.site .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 8px 16px; }
  header.site nav { order: 3; flex-basis: 100%; overflow-x: auto; gap: 18px; scrollbar-width: none; }
  header.site nav a { white-space: nowrap; }
  header.site .button { margin-left: auto; }
}

/* type */
h1 { font-size: 38px; line-height: 1.15; margin: 48px 0 16px; letter-spacing: -0.6px; }
h2 { font-size: 24px; line-height: 1.25; margin: 48px 0 10px; letter-spacing: -0.3px; }
h3 { font-size: 18px; margin: 28px 0 4px; }
.small { color: var(--muted); font-size: 14px; }

.button {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
}
.button:hover { background: var(--blue-dark); }
@media (prefers-color-scheme: dark) { .button { color: #0b1220; } }
.button.ghost { background: transparent; color: inherit; border-color: currentColor; }
.button.ghost:hover { background: rgba(127, 127, 127, .12); }

/* homepage */
.hero { background: var(--hero); color: var(--hero-text); padding: 72px 0 0; overflow: hidden; }
.hero .wrap { text-align: center; }
.hero h1 { font-size: 52px; margin: 0 auto 18px; max-width: 760px; letter-spacing: -1.2px; }
.hero .lead { color: var(--hero-muted); font-size: 20px; max-width: 680px; margin: 0 auto 28px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .button.ghost { color: var(--hero-text); }
@media (prefers-color-scheme: dark) { .hero .button:not(.ghost) { color: #0b1220; } }
.hero .facts { color: var(--hero-muted); font-size: 14px; margin: 16px 0 44px; }
.hero .shot { max-width: 1000px; margin: 0 auto; }
.hero .shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, .45);
}
@media (max-width: 700px) { .hero { padding-top: 48px; } .hero h1 { font-size: 36px; } .hero .lead { font-size: 17px; } }

.band { padding: 80px 0; }
.band.alt { background: var(--alt); }
.band h2 { text-align: center; font-size: 32px; margin: 0 0 10px; }
.band .sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 44px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 40px; }
.features h3 { margin: 12px 0 6px; }
.features p { margin: 0; color: var(--muted); font-size: 16px; }
.icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
}
.icon svg { width: 24px; height: 24px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-bottom: 1px solid var(--line); }
.card div { padding: 14px 16px 16px; }
.card h3 { margin: 0 0 4px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 960px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .cards { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split h2 { text-align: left; }
.split .sub { text-align: left; margin: 0 0 18px; }
.specs { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.specs li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; margin: 0; border-bottom: 1px solid var(--line); }
.specs li span:first-child { color: var(--muted); }
.specs li span:last-child { font-weight: 600; text-align: right; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 24px; } }

.cta { text-align: center; }
.cta .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* footer */
footer.site { margin-top: 80px; border-top: 1px solid var(--line); background: var(--alt); color: var(--muted); font-size: 14px; }
main.home + footer.site { margin-top: 0; }
footer.site .cols4 { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 48px 0 32px; }
footer.site h4 { color: var(--text); font-size: 14px; margin: 0 0 10px; }
footer.site a { display: block; color: var(--muted); text-decoration: none; margin: 6px 0; }
footer.site a:hover { color: var(--text); }
footer.site .legal { border-top: 1px solid var(--line); padding: 18px 0 28px; }
footer.site .brand { font-size: 17px; margin-bottom: 8px; color: var(--text); }
@media (max-width: 760px) { footer.site .cols4 { grid-template-columns: 1fr 1fr; } }

/* the old page screenshot, still used on inner pages */
.shot { margin: 36px -40px 0; }
.shot img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.shot figcaption { text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; }
@media (max-width: 840px) { .shot { margin: 28px 0 0; } }

table { border-collapse: collapse; width: 100%; }
td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
td:first-child { width: 110px; }

pre {
  background: var(--code);
  padding: 12px 14px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 15px;
}


h3 { font-size: 18px; margin: 28px 0 4px; }
ul { padding-left: 22px; }
li { margin: 4px 0; }
code { font-family: "JetBrains Mono", "DejaVu Sans Mono", monospace; font-size: .92em; }
p code, li code, td code { background: var(--code); padding: 1px 5px; border-radius: 4px; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; margin-top: 24px; }
.cols p { margin-top: 4px; }
@media (max-width: 700px) { .cols { grid-template-columns: 1fr; gap: 0; } }

.release {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 20px;
  margin: 20px 0;
}
.plain { margin-left: 14px; font-size: 14px; }

.tag {
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
  padding: 2px 8px;
  border-radius: 10px;
  background: #d9f2df;
  color: #1b6b34;
}
.tag.soon { background: var(--code); color: var(--muted); }
@media (prefers-color-scheme: dark) { .tag { background: #1d3a26; color: #8fe0a6; } }

.edition { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.edition img { width: 100%; height: auto; border-radius: 6px; margin-top: 6px; }

.toc { color: var(--muted); }

details { border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin-bottom: 4px; }

input[type=search] {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}
input[type=search]:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

.pkgs { list-style: none; padding: 0; margin: 0; }
.pkgs li { padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.pkgs li div:last-child { color: var(--muted); font-size: 15px; }
td:first-child code { white-space: nowrap; }
td:first-child:has(code) { width: auto; padding-right: 18px; }
@media (max-width: 560px) { td:first-child code { white-space: normal; word-break: break-all; } }

/* board */
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 16px; }
.bar a, .bar button {
  font: inherit; font-size: 14px; color: var(--muted); background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 14px; padding: 3px 12px; text-decoration: none;
}
.bar a.on, .bar button.on { color: var(--text); border-color: var(--text); font-weight: 600; }
.bar .button { margin-left: auto; color: #fff; background: var(--blue); border: 0; border-radius: 6px; font-size: 15px; padding: 6px 14px; }
.posts { list-style: none; padding: 0; margin: 0; }
.posts li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.votes { min-width: 40px; text-align: center; color: var(--muted); font-weight: 600; font-size: 15px; line-height: 1.2; }
.votes span { display: block; font-size: 18px; }
.posts h3 { margin: 0; font-size: 17px; }
.posts h3 a { color: var(--text); text-decoration: none; }
.posts h3 a:hover { text-decoration: underline; }
.posts p { margin: 2px 0 0; color: var(--muted); font-size: 15px; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.meta img { width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px; margin-right: 4px; }
.cat { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--code); color: var(--muted); margin-right: 6px; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.form label { display: block; font-weight: 600; margin: 14px 0 4px; }
.form input, .form select {
  width: 100%; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text);
}
.giscus { margin-top: 24px; }

/* inner pages */
.pagehead { background: var(--alt); border-bottom: 1px solid var(--line); padding: 56px 0 44px; }
.pagehead h1 { margin: 0 0 8px; font-size: 42px; }
.pagehead .lead { color: var(--muted); font-size: 19px; margin: 0; max-width: 720px; }
.pagehead .small { margin: 0 0 8px; }
.pagehead + main { padding-top: 8px; }
.band.tight { padding: 40px 0 8px; }
main.wide { max-width: 1120px; }
@media (max-width: 700px) { .pagehead { padding: 40px 0 32px; } .pagehead h1 { font-size: 32px; } }

/* download */
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dl { display: grid; grid-template-columns: 220px 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.dl img { width: 100%; height: 100%; object-fit: cover; object-position: top left; border-right: 1px solid var(--line); }
.dl > div { padding: 16px 20px 18px; }
.dl h3 { margin: 0 0 4px; font-size: 20px; }
.dl p { margin: 0 0 8px; font-size: 15px; }
.dl .button { margin-top: 4px; padding: 8px 16px; font-size: 15px; }
@media (max-width: 960px) { .dl-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .dl { grid-template-columns: 1fr; } .dl img { height: 160px; border-right: 0; border-bottom: 1px solid var(--line); } }

/* editions: screenshot and text side by side, alternating */
main.wide .edition {
  display: grid; grid-template-columns: 3fr 2fr; gap: 0 40px; align-items: center;
  border-bottom: 1px solid var(--line); padding: 40px 0; grid-template-areas: "img title" "img text" "img good";
}
main.wide .edition:nth-of-type(even) { grid-template-columns: 2fr 3fr; grid-template-areas: "title img" "text img" "good img"; }
main.wide .edition h2 { grid-area: title; margin: 0 0 4px; align-self: end; font-size: 28px; }
main.wide .edition img { grid-area: img; margin: 0; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
main.wide .edition p:not(.small) { grid-area: text; margin: 6px 0; }
main.wide .edition p.small { grid-area: good; align-self: start; margin: 4px 0 0; }
main.wide .edition:not(:has(img)) { grid-template-columns: 1fr; grid-template-areas: "title" "text" "good"; }
@media (max-width: 860px) {
  main.wide .edition, main.wide .edition:nth-of-type(even) { grid-template-columns: 1fr; grid-template-areas: "title" "img" "text" "good"; }
  main.wide .edition img { margin: 10px 0; }
}

/* docs: contents beside the article */
main.docs { max-width: 1120px; display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 48px; justify-content: center; }
.toc { position: sticky; top: 88px; align-self: start; margin-top: 48px; font-size: 15px; }
.toc h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.toc a { display: block; padding: 5px 0 5px 12px; color: var(--muted); text-decoration: none; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--text); border-left-color: var(--blue); }
@media (max-width: 900px) {
  main.docs { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; margin-top: 24px; display: flex; flex-wrap: wrap; gap: 6px; }
  .toc h4 { flex-basis: 100%; }
  .toc a { border: 1px solid var(--line); border-radius: 14px; padding: 3px 12px; font-size: 14px; }
}

/* about: roadmap timeline */
.timeline { list-style: none; padding: 0; margin: 16px 0; }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; margin: 0; padding: 0 0 22px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 27px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .ver {
  width: 56px; height: 32px; border-radius: 16px; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; border: 2px solid var(--line); color: var(--muted); background: var(--bg);
}
.timeline li.done .ver { background: var(--blue); border-color: var(--blue); color: #fff; }
@media (prefers-color-scheme: dark) { .timeline li.done .ver { color: #0b1220; } }
.timeline li div { padding-top: 4px; }

/* what's new: one block per release */
main.news h2 { border-top: 1px solid var(--line); padding-top: 32px; margin-top: 40px; }
main.news h2:first-of-type { border-top: 0; padding-top: 0; }

/* packages search */
input[type=search].big { font-size: 19px; padding: 14px 16px; border-radius: 10px; border-width: 2px; }

/* 404 */
.notfound { text-align: center; padding: 72px 0 24px; }
.notfound .code { font-size: 96px; font-weight: 800; letter-spacing: -3px; margin: 0; color: var(--blue); line-height: 1; }
.notfound h1 { margin: 12px 0 6px; }
