:root {
  color-scheme: light dark;
  --bg: #f6f7fb; --panel: #ffffff; --text: #1b2030; --muted: #5a6478; --line: #d9deea;
  --accent: #3a56d4; --accent-text: #ffffff; --code: #eef1f8;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0e14; --panel: #151a26; --text: #e6e9f0; --muted: #9aa4ba; --line: #2a3142;
          --accent: #8ea2ff; --accent-text: #0b0e14; --code: #1d2434; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
/* the hero is a night banner that runs the full width, in both colour schemes (the sky of the picture the ghost comes from) */
header.hero { padding: 56px 0 36px; color: #e6e9f0; background: #0b0e1c url(hero-bg.svg) center / cover no-repeat; border-bottom: 1px solid #2a3142; }
header.hero.compact { padding: 28px 0 20px; }
.hero h1 { color: #f4f5fb; text-shadow: 0 2px 14px rgba(0, 0, 0, .65); }
.hero .tag { color: #cfd6ea; text-shadow: 0 1px 10px rgba(0, 0, 0, .7); }
.hero code { background: rgba(255, 255, 255, .14); color: #f0f2fb; border-radius: 4px; padding: 1px 5px; }
.hero a:not([class]) { color: #d3dbff; }
.hero .btns a { background: #8ea2ff; color: #0b0e14; }
.hero .btns a.alt { background: rgba(11, 14, 28, .55); color: #d3dbff; border: 1px solid #8ea2ff; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 8px; letter-spacing: -0.02em; display: flex; align-items: center; gap: .4em; }
/* the logo must override ".hero img" (full-width banner with margin and border) below */
.hero h1 .logo { width: 2em; height: 2em; max-height: none; margin: 0; border: 0; border-radius: 22%; object-fit: contain; display: block; flex: none; }
.tag { font-size: 1.2rem; color: var(--muted); max-width: 46rem; margin: 0 0 20px; }
.btns a { display: inline-block; margin: 0 8px 8px 0; padding: 8px 16px; border-radius: 8px; text-decoration: none;
          background: var(--accent); color: var(--accent-text); font-weight: 600; }
.btns a.alt { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.hero-photo img { width: 100%; max-height: 380px; object-fit: cover; border-radius: 12px; margin-top: 20px; display: block; border: 1px solid var(--line); }
nav.toc { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
nav.toc a { margin-right: 14px; white-space: nowrap; }
section { padding: 36px 0 8px; }
h2 { font-size: 1.7rem; margin: 0 0 12px; }
h3 { font-size: 1.15rem; margin: 0 0 6px; }
h3 small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.num { display: inline-block; min-width: 1.8em; padding: 0 6px; border-radius: 6px; background: var(--accent); color: var(--accent-text); text-align: center; font-size: .9rem; }
p, li { max-width: 52rem; }
code, pre { font: .9em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code); border-radius: 6px; }
code { padding: 1px 5px; }
pre { padding: 12px 14px; overflow-x: auto; max-width: 52rem; }
table { border-collapse: collapse; width: 100%; max-width: 52rem; background: var(--panel); }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--code); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px 14px; }
article.page { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px 18px; margin: 0 0 18px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 10px; }
figure { margin: 0; }
figure img { width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid var(--line); background: #000; }
figcaption { font-size: .85rem; color: var(--muted); margin-top: 4px; }
img.wide { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); display: block; }
.note { color: var(--muted); font-style: italic; }
.cols + h3 { margin-top: 28px; }
ul.timeline { list-style: none; padding: 0; border-left: 3px solid var(--accent); margin-left: 6px; }
ul.timeline li { margin: 0 0 14px; padding-left: 16px; }
ul.timeline b { display: block; }
footer { margin-top: 48px; padding: 24px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
footer .copyright { margin: 14px 0 0; }
/* site navigation: a bar with the key links and a hamburger menu on every page, a pager at the end of the page, a jump list on the long page */
nav.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 36px 0 0; }
nav.pager a { display: block; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-decoration: none; font-weight: 600; }
nav.pager a.next { margin-left: auto; text-align: right; }
nav.pager small { color: var(--muted); font-weight: 400; }
nav.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
nav.jump a { min-width: 2.3em; padding: 3px 8px; text-align: center; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); text-decoration: none; font-size: .9rem; }
.explore { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.explore a.card { display: block; padding-top: 12px; color: inherit; text-decoration: none; }
.explore a.card:hover { border-color: var(--accent); }
.explore a.card h3 { color: var(--accent); }
.explore a.card img { width: 100%; height: auto; display: block; margin-top: 8px; border-radius: 6px; border: 1px solid var(--line); background: #000; }
:target { scroll-margin-top: 64px; }
/* groups of pages: a tab bar under the banner and thumbnail grids on the overview pages */
nav.tabs { background: var(--panel); border-bottom: 1px solid var(--line); }
nav.tabs .wrap { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; padding-bottom: 10px; }
nav.tabs a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: .92rem; background: var(--bg); }
nav.tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
nav.tabs a.ext { margin-left: auto; border-style: dashed; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin: 10px 0 8px; }
.thumbs a { text-decoration: none; color: var(--text); font-size: .85rem; }
.thumbs img { width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid var(--line); background: #000; }
.thumbs span { display: block; margin-top: 3px; }
section h2 a { text-decoration: none; color: inherit; }
/* the bar: brand, two key links, a hamburger menu with everything */
nav.sitenav { position: sticky; top: 0; z-index: 20; background: var(--panel); border-bottom: 1px solid var(--line); }
nav.sitenav .wrap { position: relative; display: flex; align-items: center; gap: 4px 6px; padding-top: 6px; padding-bottom: 6px; }
nav.sitenav a.brand { display: flex; align-items: center; gap: 8px; margin-right: 10px; padding: 4px 8px 4px 0; font-weight: 700; color: var(--text); text-decoration: none; }
nav.sitenav a.brand img { display: block; border-radius: 22%; }
nav.sitenav a.key { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 600; font-size: .95rem; }
nav.sitenav a.key:hover { background: var(--code); }
nav.sitenav a.key.active { background: var(--accent); color: var(--accent-text); }
nav.sitenav details.menu { margin-left: auto; }
nav.sitenav summary { display: flex; align-items: center; gap: 10px; padding: 7px 12px; list-style: none; cursor: pointer; user-select: none; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; font-size: .95rem; }
nav.sitenav summary::-webkit-details-marker { display: none; }
nav.sitenav summary:hover, nav.sitenav details[open] > summary { background: var(--code); }
nav.sitenav summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.burger { position: relative; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: background .15s; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .15s, top .15s; }
.burger::before { top: -6px; }
.burger::after { top: 6px; }
details[open] .burger { background: transparent; }
details[open] .burger::before { top: 0; transform: rotate(45deg); }
details[open] .burger::after { top: 0; transform: rotate(-45deg); }
nav.sitenav .panel { position: absolute; right: 16px; top: calc(100% + 6px); width: min(740px, calc(100vw - 32px)); max-height: calc(100vh - 80px); overflow: auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 22px; padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, .3); }
nav.sitenav .panel h2 { margin: 0 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
nav.sitenav .panel ul { margin: 0; padding: 0; list-style: none; }
nav.sitenav .panel li { max-width: none; }
nav.sitenav .panel li a { display: block; padding: 6px 8px; border-radius: 6px; color: var(--text); text-decoration: none; }
nav.sitenav .panel li a:hover { background: var(--code); }
nav.sitenav .panel li a[aria-current="page"] { background: var(--accent); color: var(--accent-text); font-weight: 600; }
@media (max-width: 560px) { nav.sitenav a.key { display: none; } nav.sitenav a.brand { margin-right: 0; } }
