/* Varsto website template. Colours are tokens; dark mode redefines them. */
:root {
  --bg: #fbfbfa; --surface: #ffffff; --text: #16181d; --muted: #566070;
  --border: #e3e5ea; --accent: #2b57d6; --accent-contrast: #ffffff;
  --warn-bg: #fff4d6; --warn-text: #5a3d00; --warn-border: #f0d58a;
  --series-1: #2a78d6; --series-2: #eb6834;
  --radius: 12px; --maxw: 72rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0d0f12; --surface: #14171c; --text: #eceef2; --muted: #9aa3b2;
    --border: #232832; --accent: #8aa9ff; --accent-contrast: #0d0f12;
    --warn-bg: #2a2210; --warn-text: #f6d98a; --warn-border: #5b4a1d;
    --series-1: #3987e5; --series-2: #d95926;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f12; --surface: #14171c; --text: #eceef2; --muted: #9aa3b2;
  --border: #232832; --accent: #8aa9ff; --accent-contrast: #0d0f12;
  --warn-bg: #2a2210; --warn-text: #f6d98a; --warn-border: #5b4a1d;
  --series-1: #3987e5; --series-2: #d95926;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.6 var(--font); }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-contrast); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
.alpha { background: var(--warn-bg); color: var(--warn-text); border-bottom: 1px solid var(--warn-border); font-size: .95rem; }
.alpha .wrap { padding-top: .6rem; padding-bottom: .6rem; }
.alpha strong { font-weight: 700; }
header.site { border-bottom: 1px solid var(--border); background: var(--bg); }
header.site .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 4rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: .01em; }
.brand img { width: 28px; height: 28px; }
nav.main { margin-left: auto; display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
nav.main a { color: var(--muted); text-decoration: none; padding: .4rem .8rem; border-radius: 8px; }
nav.main a:hover { color: var(--text); background: var(--surface); }
nav.main a[aria-current="page"] { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
button.theme { margin-left: .25rem; background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .7rem; font: inherit; cursor: pointer; }
button.theme:hover { color: var(--text); background: var(--surface); }
main { padding: 3rem 0 4rem; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.1; margin: 0 0 1rem; letter-spacing: -.02em; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 .75rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 42rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin-top: 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.card h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); }
.todo { border-style: dashed; }
.note { color: var(--muted); font-size: .95rem; }
footer.site { border-top: 1px solid var(--border); padding: 2rem 0; color: var(--muted); font-size: .95rem; }
footer.site .wrap { display: flex; gap: 1rem 2rem; flex-wrap: wrap; justify-content: space-between; }
@media (prefers-reduced-motion: no-preference) { a, button { transition: background-color .15s, color .15s; } }
/* Content pages */
a.button { display: inline-block; background: var(--accent); color: var(--accent-contrast); padding: .6rem 1.1rem; border-radius: 10px; text-decoration: none; font-weight: 600; margin: .5rem .5rem .5rem 0; }
a.button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.prose { max-width: 52rem; }
.prose h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin: 1.5rem 0 .5rem; font-size: 1.15rem; }
.prose blockquote { margin: 1rem 0; padding: .75rem 1rem; border-left: 4px solid var(--warn-border); background: var(--warn-bg); color: var(--warn-text); border-radius: 0 8px 8px 0; }
.prose blockquote p { margin: 0; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; overflow-x: auto; font-size: .92rem; line-height: 1.5; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .95em; }
p code, li code, td code { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 0 .3em; }
table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .95rem; display: block; overflow-x: auto; }
th, td { text-align: left; vertical-align: top; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
code.sum { font-size: .8rem; word-break: break-all; }
.doclist, .posts { list-style: none; padding: 0; }
.doclist li, .posts li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.posts time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: .5rem; }
pre.licence { white-space: pre-wrap; }
figure.hero { margin: 2rem 0 1rem; }
figure.hero img { width: 100%; height: auto; display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem; }
figure.hero figcaption { color: var(--muted); font-size: .95rem; margin-top: .5rem; }
.feature { display:grid; grid-template-columns: minmax(16rem, 1fr) 1.2fr; gap:1.5rem; align-items:start; margin:2.5rem 0; }
.feature img { width:100%; height:auto; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); }
.feature h2 { grid-column: 1 / -1; margin:0 0 .25rem; }
.feature div > p:first-child { margin-top:0; }
.badge { display:inline-block; font-size:.7rem; font-weight:600; vertical-align:middle; background:var(--warn-bg); color:var(--warn-text); border:1px solid var(--warn-border); border-radius:6px; padding:.1rem .45rem; margin-left:.4rem; }
@media (max-width: 48rem) { .feature { grid-template-columns: 1fr; } }

.shot { margin:1.5rem 0; }
.shot img { width:100%; height:auto; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); }
.shot figcaption { font-size:.9rem; color:var(--muted); margin-top:.5rem; }
.shots-row { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; max-width:40rem; }
.shots-row.three { grid-template-columns:repeat(3, 1fr); max-width:60rem; }
@media (max-width: 60rem) { .shots-row.three { grid-template-columns:1fr 1fr; } }
@media (max-width: 40rem) { .shots-row { grid-template-columns:1fr; } }

.dl-release { color:var(--muted); }
.dl-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(13.5rem, 1fr)); gap:1rem; margin:1rem 0 1.5rem; }
.dl-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:1.1rem; display:flex; flex-direction:column; gap:.6rem; }
.dl-head { display:flex; align-items:center; gap:.6rem; }
.dl-head h3 { margin:0; font-size:1.1rem; }
.dl-icon { width:28px; height:28px; fill:var(--accent); flex:none; }
.dl-primary { display:block; text-align:center; background:var(--accent); color:var(--accent-contrast); font-weight:600; padding:.6rem .8rem; border-radius:10px; text-decoration:none; }
.dl-primary:hover { filter:brightness(1.08); }
.dl-primary.dl-disabled { background:var(--surface); color:var(--muted); border:1px solid var(--border); }
.dl-meta { font-size:.8rem; color:var(--muted); margin:0; overflow-wrap:anywhere; }
.dl-alt { list-style:none; padding:0; margin:0; font-size:.9rem; }
.dl-alt li { padding:.15rem 0; }
.dl-status { font-size:.85rem; color:var(--muted); margin:auto 0 0; }
.dl-all { margin:1rem 0; }
.dl-all table { margin-top:.5rem; }

/* Screenshots follow the page theme: one of the pair is shown. */
.shot-dark { display:none; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .shot-dark { display:block; }
  :root[data-theme="auto"] .shot-light { display:none; }
}
:root[data-theme="dark"] .shot-dark { display:block; }
:root[data-theme="dark"] .shot-light { display:none; }
.shots-single { grid-template-columns: 1fr; max-width: 20rem; }

/* On-this-page table of contents (How it works). */
.toc { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:1rem 1.25rem; margin:1.5rem 0 1rem; max-width:42rem; }
.toc-title { margin:0 0 .4rem; font-weight:600; }
.toc ol { margin:0; padding-left:1.4rem; columns:2 14rem; column-gap:2rem; }
.toc li { padding:.1rem 0; break-inside:avoid; }
.feature > h3 { grid-column: 1 / -1; margin:0 0 .25rem; font-size:1.15rem; }
h3 { font-size:1.15rem; margin:2rem 0 .5rem; }
[id] { scroll-margin-top:1rem; }
.tech > p, .tech > ul, .tech > ol { max-width: 52rem; }

/* Benchmarks: bar charts drawn as inline SVG, styled here (no inline styles). */
.bench-chart { width:100%; max-width:44rem; height:auto; display:block; margin:.5rem 0 1rem; }
.bench-chart text { font: 12px var(--font); }
.bench-label { fill:var(--text); }
.bench-value { fill:var(--muted); font-variant-numeric: tabular-nums; }
.bench-axis { stroke:var(--border); stroke-width:1; }
.bench-p2p { fill:var(--series-1); }
.bench-s3 { fill:var(--series-2); }
.bench-legend { font-size:.9rem; margin:1rem 0 0; }
.bench-key { display:inline-block; width:.8rem; height:.8rem; border-radius:3px; vertical-align:-.05rem; margin:0 .35rem 0 .2rem; }
.bench-key.bench-p2p-key { background:var(--series-1); }
.bench-key.bench-s3-key { background:var(--series-2); margin-left:1rem; }
.bench-table td, .bench-table th { white-space:nowrap; }
.bench-table td .note { font-size:.8rem; }

/* Comparison pages */
.compare-table th[scope=row] { text-align: left; white-space: nowrap; vertical-align: top; padding-right: 1rem; }
.compare-table td { vertical-align: top; }
.compare-table td, .compare-table th { padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
.compare-table thead th { text-align: left; }
.compare-overview { font-size: .88rem; }
.compare-overview td:nth-child(2) { background: var(--surface); }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--accent, currentColor); }
.compare-table:not(.compare-overview) { display: table; table-layout: fixed; }
.compare-table:not(.compare-overview) th[scope=row] { width: 24%; white-space: normal; }
@media (max-width: 700px) {
  .compare-table:not(.compare-overview) { font-size: .86rem; }
  .compare-table:not(.compare-overview) th[scope=row] { width: 30%; }
  .compare-table td, .compare-table th { padding: .45rem .35rem; }
}
