:root {
  color-scheme: light dark;
  --accent: #1f7361;
  --accent-soft: #e3f1ed;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --text: #1c2024;
  --muted: #646d76;
  --border: #dde1e5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #4fb39b;
    --accent-soft: #17332c;
    --bg: #111416;
    --surface: #1a1e21;
    --text: #e7eaec;
    --muted: #9aa4ad;
    --border: #2c3236;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

header { background: var(--surface); border-bottom: 1px solid var(--border); }
header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; min-height: 64px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; color: var(--text); font-weight: 600; font-size: 19px; text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 16px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current] { color: var(--accent); }

main.wrap { padding-block: 32px 48px; }
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 16px; }
h2 { font-size: 21px; line-height: 1.3; margin: 32px 0 8px; }
.lead { font-size: 20px; color: var(--muted); margin-top: 0; }
.date { color: var(--muted); }
.note { background: var(--accent-soft); border-radius: 8px; padding: 14px 16px; }
ul { padding-left: 22px; }
li { margin-bottom: 6px; }

footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 15px; padding-block: 18px; }

main.wide { max-width: 980px; }
.toc { columns: 2; column-gap: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px 14px 36px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; margin: 18px 0 8px; }
figure { margin: 0; }
figure img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
figcaption { color: var(--muted); font-size: 15px; line-height: 1.4; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: 15px; line-height: 1.45; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

@media (max-width: 480px) {
  .toc { columns: 1; }
  .shots { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* The language menu: a globe that opens a list, without scripts (the site allows none). */
nav { order: 1; }
.lang { order: 2; position: relative; }
.lang summary { display: flex; align-items: center; gap: 4px; list-style: none; cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { color: var(--accent); background: var(--accent-soft); }
.lang ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 160px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 16px rgb(0 0 0 / 12%); }
.lang li { margin: 0; }
.lang a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.lang a:hover { background: var(--accent-soft); }
.lang a[aria-current] { color: var(--accent); font-weight: 600; }

@media (max-width: 600px) {
  nav { order: 3; flex-basis: 100%; }
}

.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { color: var(--muted); font-size: 13px; font-weight: 400; }
