:root {
  --bg: #0f1412; --panel: #161d1a; --panel2: #1c2521; --line: #26302b;
  --text: #e4ebe7; --muted: #8d9a93; --accent: #2f8653; --accent2: #e2b23a;
  --radius: 10px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6f4; --panel: #ffffff; --panel2: #f0f3f1; --line: #d9e0db;
    --text: #17201b; --muted: #5f6d65; --accent: #1d6640; --accent2: #9a7108;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
header { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header .wrap { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand img { display: block; }
nav { display: flex; gap: 18px; margin-left: auto; }
nav a { color: var(--muted); font-weight: 500; }
nav a.on, nav a:hover { color: var(--text); text-decoration: none; }
main { padding: 28px 16px 48px; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 18px 0; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); font-weight: 400; font-size: 0.92em; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 0 0 18px; }
.hero { text-align: center; padding: 18px 0 24px; }
.hero img { max-width: 100%; height: auto; }
.lead { font-size: 20px; max-width: 680px; margin: 12px auto 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-bottom: 18px; }
.grid .card { margin: 0; }
.grid p { margin: 0; color: var(--muted); }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 12px; }
.btn { display: inline-flex; flex-direction: column; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 600; }
.btn span { font-weight: 400; font-size: 13px; color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary span { color: #d8efe1; }
.btn:hover { text-decoration: none; filter: brightness(1.1); }
pre { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: 14px; line-height: 1.45; }
code { font-family: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
:not(pre) > code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.num { text-align: right; white-space: nowrap; }
.assets { margin-top: 10px; }
.sha { font-size: 12px; word-break: break-all; color: var(--muted); }
.doc { overflow-wrap: anywhere; }
.doc img { max-width: 100%; height: auto; }
.doc table { display: block; overflow-x: auto; }
.doc h2 { margin-top: 28px; padding-top: 8px; border-top: 1px solid var(--line); }
.doc h3 { margin-top: 22px; }
@media (max-width: 640px) {
  nav { margin-left: 0; width: 100%; padding-bottom: 8px; }
  .lead { font-size: 18px; }
  .assets th:nth-child(3), .assets td:nth-child(3) { display: none; }
}
.license { white-space: pre-wrap; background: none; border: 0; padding: 0; font-size: 14px; }

.shots-home { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-bottom: 18px; }
.shots-home a { color: inherit; text-decoration: none; }
figure { margin: 0; }
figure img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; line-height: 1.4; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px 16px; margin-top: 14px; }
.gallery figure:target img { outline: 2px solid var(--accent2); }

/* The screenshot viewer (viewer.js). A tall picture (.tall) keeps its
   width and scrolls in .v-scroll; the arrows and the caption stay put. */
#viewer { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #070a09; color: #e4ebe7; }
#viewer[open] { display: flex; flex-direction: column; }
#viewer::backdrop { background: #070a09; }
#viewer button { background: rgba(255, 255, 255, 0.08); color: #e4ebe7; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 8px; cursor: pointer; font: inherit; }
#viewer button:hover { background: rgba(255, 255, 255, 0.18); }
html.viewing { overflow: hidden; }
.v-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; font-size: 14px; color: #a9b5ae; }
.v-bar button { width: 40px; height: 40px; font-size: 18px; }
.v-stage { flex: 1; min-height: 0; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.v-stage > button { flex: none; width: 48px; height: 72px; font-size: 34px; line-height: 1; }
.v-scroll { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.v-scroll img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
#viewer.tall .v-scroll { display: block; overflow-y: auto; overscroll-behavior: contain; }
.v-scroll:focus { outline: none; }
#viewer.tall .v-scroll img { max-height: none; height: auto; margin: 0 auto; }
.v-text { flex: none; margin: 0 auto; padding: 12px 16px 18px; max-width: 900px; text-align: center; line-height: 1.45; }
.v-group { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #a9b5ae; margin-bottom: 2px; }
.v-cap { font-size: 16px; }
@media (max-width: 640px) {
  .v-stage { gap: 0; padding: 0 4px; position: relative; }
  .v-stage > button { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); width: 36px; height: 56px; font-size: 26px; background: rgba(0, 0, 0, 0.55); }
  .v-prev { left: 6px; }
  .v-next { right: 6px; }
}
