/* ── Design tokens ── */
:root {
  --accent-1: #cc3311;
  --accent-2: #8b1a1a;
  --accent-grad: linear-gradient(135deg, #d2401a, #8b1a1a);
  /* The accent as channels, so shadows and tints can take an alpha without
     restating the colour. */
  --accent-1-rgb: 204, 51, 17;
  --accent-2-rgb: 139, 26, 26;
  --ink: #1a1a1a;
  --paper: #ffffff;
  --paper-alt: #faf7f6;
  --muted: #6b5b57;
  --border: #ece2df;
  /* Surfaces and states. Every colour in this file goes through a token, so a
     dark theme is a second block of these and nothing else. */
  --tint-callout: #fff4f0;
  --tint-panel: #f5efed;
  --tint-page: #fdfaf9;
  --on-accent: #ffffff;
  --disabled-bg: #ddd2ce;
  --disabled-ink: #8a7772;
  --max-width: 760px;
  --header-height: 60px;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

a {
  color: var(--accent-1);
  text-decoration: none;
}
a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}
img {
  max-width: 100%;
}

/* ── Container ── */
.container {
  max-width: calc(var(--max-width) + 2rem);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Site header ── */
.site-header {
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}

.site-header::after {
  content: '';
  display: block;
  height: 3px;
  background: var(--accent-grad);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: var(--header-height);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.site-brand:hover {
  color: var(--accent-1);
  text-decoration: none;
}
.site-brand img {
  width: 32px;
  height: 32px;
}

/* ── Navigation ── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  margin-left: auto;
}

.nav-link {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition:
    color 0.15s,
    background-color 0.15s;
}

.nav-link:hover {
  color: var(--accent-1);
  background: var(--tint-callout);
  text-decoration: none;
}
.nav-link.active {
  color: var(--accent-1);
  font-weight: 600;
}

/* ── Language switcher ── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.lang-switcher .flag {
  display: block;
  height: 1rem;
  width: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.lang-switcher a,
.lang-switcher .lang-active {
  font-size: 1.15rem;
  line-height: 1;
  text-decoration: none;
  padding: 0.1rem 0.15rem;
  border-radius: 3px;
  transition: opacity 0.15s;
  display: inline-flex;
}

.lang-switcher a {
  opacity: 0.4;
}
.lang-switcher a:hover {
  opacity: 0.75;
  text-decoration: none;
}
.lang-switcher .lang-active {
  opacity: 1;
}

/* ── Site footer ── */
.site-footer {
  background: var(--paper-alt);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  text-align: center;
}

.footer-inner a {
  color: var(--muted);
}
.footer-inner a:hover {
  color: var(--accent-1);
}
.footer-sep {
  opacity: 0.4;
}

/* ── Article (single page) ── */
.article-wrap {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.article-title {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.5rem;
}

.article-meta {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

/* ── Table of contents ── */
.toc {
  background: var(--paper-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0 0 2rem;
  font-size: 0.9rem;
}

.toc summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc summary::before {
  content: '▸';
  font-size: 0.7em;
  color: var(--accent-1);
  transition: transform 0.15s;
  display: inline-block;
}

.toc[open] summary::before {
  transform: rotate(90deg);
}

.toc nav {
  margin-top: 0.6rem;
}

.toc ul {
  margin: 0;
  padding-left: 1rem;
  list-style: none;
}

.toc ul ul {
  padding-left: 1rem;
  margin-top: 0.1rem;
}
.toc li {
  margin: 0.2rem 0;
}
.toc a {
  color: var(--muted);
}
.toc a:hover {
  color: var(--accent-1);
}
/* The entry of the section being read, and its chapter — toc-sync.html. */
.toc a.is-active {
  color: var(--accent-2);
  font-weight: 700;
  box-shadow: -3px 0 0 var(--accent-1);
  padding-left: 0.4rem;
  margin-left: -0.4rem;
  border-radius: 2px;
}
.toc a.is-chapter {
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-1-rgb), 0.5);
  text-underline-offset: 3px;
}
/* A chapter, as in the page: bold and in the accent, a little apart. */
.toc nav > ul > li {
  margin-top: 0.55rem;
}
.toc nav > ul > li > a {
  font-weight: 700;
  color: var(--accent-2);
}

/* ── ToC sidebar (hidden on mobile, shown on wide screens) ── */
.toc-sidebar {
  display: none;
}

.toc-sidebar-title {
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.1rem;
}

/* ── Article body ── */
.article-body h2 {
  /* A chapter: a band across the whole column, tinted, its title in the
     accent — the long pages read as parts at a glance. The rule is the
     section's, under each h3. */
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-2);
  background: linear-gradient(90deg, rgba(var(--accent-1-rgb), 0.14), rgba(var(--accent-1-rgb), 0.04));
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  margin: 3rem 0 1rem;
  scroll-margin-top: calc(var(--header-height) + 0.5rem);
}

/* A heading reached from the contents stops below the sticky header. */
.article-body :is(h3, h4) {
  scroll-margin-top: calc(var(--header-height) + 0.5rem);
}

.article-body h3 {
  /* A section: plainly a heading, over a rule in the accent. */
  font-size: 1.3rem;
  font-weight: 700;
  margin: 2rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid rgba(var(--accent-1-rgb), 0.35);
  line-height: 1.3;
}

.article-body h4 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 1.5rem 0 0.4rem;
}

.article-body p {
  margin: 0 0 1rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1rem 0;
  padding-left: 1.4rem;
}

.article-body li + li {
  margin-top: 0.2rem;
}

.article-body code {
  background: var(--tint-panel);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.875em;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  overflow-wrap: break-word;
}

.article-body pre {
  background: var(--tint-panel);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.article-body blockquote {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem 0.75rem 1.25rem;
  border-left: 4px solid var(--accent-1);
  background: var(--paper-alt);
  color: var(--muted);
}

.article-body blockquote p {
  margin-bottom: 0;
}

.article-body table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}

.article-body th,
.article-body td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  overflow-wrap: break-word;
}

.article-body th {
  background: var(--paper-alt);
  font-weight: 600;
}
.article-body tr:nth-child(even) td {
  background: var(--tint-page);
}

.article-body img {
  border: 1px solid var(--ink);
  border-radius: 4px;
  display: block;
  margin: 1rem auto;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── List page ── */
.list-wrap {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.list-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.list-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}
.list-description {
  color: var(--muted);
  margin: 0;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.post-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.post-card:hover {
  border-color: var(--accent-1);
  box-shadow: 0 2px 10px rgba(var(--accent-1-rgb), 0.08);
}

.post-card-title a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.post-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
}

.post-card-title a {
  color: var(--ink);
}
.post-card-title a:hover {
  color: var(--accent-1);
  text-decoration: none;
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.post-card-summary {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.post-card-chapters {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.post-card-chapters li {
  position: relative;
  padding-left: 0.7rem;
}
.post-card-chapters li::before {
  content: '·';
  position: absolute;
  left: 0;
}

.read-more {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-1);
}
.read-more:hover {
  color: var(--accent-2);
  text-decoration: none;
}
.read-more::after {
  content: ' →';
}

/* ── Mermaid diagrams ── */
.mermaid {
  overflow-x: auto;
  text-align: center;
  margin: 1.5rem 0;
  background: var(--paper-alt);
  border-radius: 6px;
  padding: 1.25rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition:
    opacity 0.15s,
    box-shadow 0.15s;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-grad);
  color: var(--on-accent);
  box-shadow: 0 2px 8px rgba(var(--accent-1-rgb), 0.3);
}

.btn-primary:hover {
  opacity: 0.9;
  color: var(--on-accent);
  box-shadow: 0 4px 16px rgba(var(--accent-1-rgb), 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-1);
  border: 2px solid var(--accent-1);
}

.btn-secondary:hover {
  background: rgba(var(--accent-1-rgb), 0.06);
  color: var(--accent-1);
}

.btn-disabled {
  background: var(--disabled-bg);
  color: var(--disabled-ink);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-disabled:hover {
  opacity: 1;
  color: var(--disabled-ink);
}

/* ── Responsive ── */
@media (min-width: 900px) {
  /* Two-column article layout: content + sticky ToC sidebar */
  .container.article-wrap {
    max-width: calc(var(--max-width) + 240px + 2rem + 2.5rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 2rem;
    align-items: start;
  }
  .article-wrap > article {
    min-width: 0;
  }
  .toc-inline {
    display: none;
  }
  .toc-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    max-height: calc(100vh - var(--header-height) - 3rem);
    overflow-y: auto;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 16px;
  }
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    padding: 0.6rem 0;
    row-gap: 0.4rem;
  }
  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: center;
    flex-wrap: wrap;
  }
  .site-nav .nav-link {
    padding: 0.25rem 0.4rem;
  }
  .article-title {
    font-size: 1.5rem;
  }
}

/* The documentation's four kinds — learning, doing, looking up,
   understanding — each a heading over a grid of its pages. */
.doc-kind {
  margin: 0 0 2.5rem;
}
.doc-kind-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}
.doc-kind .list-description {
  margin: 0 0 1rem;
}
.doc-kind .post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}
.doc-kind .post-card {
  padding: 1rem 1.2rem;
}
.doc-kind .post-card-summary {
  margin: 0;
}

/* A screenshot in a page: as wide as the text, framed, never wider. */
.article-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.article-body img {
  cursor: zoom-in;
}
.article-body a[href]:not([href$=".webp"]):not([href$=".png"]):not([href$=".jpg"]) img {
  cursor: pointer;
}

.shot {
  margin: 1.25rem 0 1.5rem;
}
.shot figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* ── The home page — redesigned 2026-10-07 (layouts/index.html) ── */
.home {
  --home-grad: linear-gradient(135deg, #f4772a 0%, #d2401a 45%, #8b1a1a 100%);
  --home-chip: #fff1ec;
  --home-shadow: 0 1px 2px rgba(60, 20, 10, 0.05), 0 8px 24px rgba(60, 20, 10, 0.07);
}
.home-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}
.home-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 0;
  text-align: center;
}
.home-hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 680px;
  background:
    radial-gradient(closest-side, rgba(242, 110, 40, 0.22), transparent 70%),
    radial-gradient(closest-side at 80% 30%, rgba(139, 26, 26, 0.16), transparent 70%);
  pointer-events: none;
}
.home-hero .home-wrap {
  position: relative;
}
.home-badge {
  display: inline-block;
  font-size: 13px;
  color: var(--accent-1);
  background: var(--home-chip);
  border: 1px solid rgba(var(--accent-1-rgb), 0.25);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.home-hero h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 auto 18px;
  max-width: 15ch;
}
.home-accent {
  color: var(--accent-1);
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .home-accent {
    background: var(--home-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.home-lead {
  font-size: 20px;
  color: var(--muted);
  max-width: 660px;
  margin: 0 auto 30px;
}
.home-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.home-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 16px;
  border: 1px solid transparent;
  transition: transform 0.12s;
}
.home-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.home-btn-primary {
  background: var(--home-grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(var(--accent-1-rgb), 0.3);
}
.home-btn-primary:hover {
  color: #fff;
}
.home-btn-disabled {
  background: var(--disabled-bg);
  color: var(--disabled-ink);
  box-shadow: none;
  cursor: not-allowed;
}
.home-btn-disabled:hover {
  transform: none;
  color: var(--disabled-ink);
}
.home-btn-ghost {
  border-color: var(--border);
  color: var(--ink);
  background: var(--paper);
}
.home-fine {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 18px;
}
/* The sections of the page, as chips under the buttons. */
.home-jump {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 40px;
}
.home-jump a {
  font-size: 14px;
  color: var(--accent-2);
  background: var(--paper);
  border: 1px solid rgba(var(--accent-1-rgb), 0.25);
  padding: 5px 14px;
  border-radius: 999px;
  text-decoration: none;
}
.home-jump a:hover {
  color: var(--on-accent);
  background: var(--accent-1);
  border-color: var(--accent-1);
}
/* A section reached by its link stops below the sticky header. */
.home-block[id] {
  scroll-margin-top: var(--header-height);
}
.home-window {
  margin: 0 auto;
  max-width: 1040px;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-bottom: 0;
  box-shadow: 0 30px 80px rgba(60, 20, 10, 0.25);
}
.home-window img {
  display: block;
  width: 100%;
  height: auto;
}
.home-facts {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--paper-alt);
}
.home-facts .home-wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.home-fact {
  padding: 26px 20px;
  text-align: center;
}
.home-fact + .home-fact {
  border-left: 1px solid var(--border);
}
.home-fact b {
  display: block;
  font-size: 26px;
  letter-spacing: -0.01em;
}
.home-fact span {
  font-size: 14px;
  color: var(--muted);
}
.home-block {
  padding: 88px 0;
}
.home-last {
  padding-top: 0;
}
.home-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-1);
}
.home-title {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 8px 0 12px;
}
.home-sub {
  color: var(--muted);
  max-width: 680px;
  margin: 0 0 44px;
  font-size: 18px;
}
.home-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
/* A box that opens its section of the user guide: the title is the link,
   stretched over the whole box. */
.home-group,
.home-shot {
  position: relative;
}
.home-card-link {
  color: inherit;
  text-decoration: none;
}
.home-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.home-card-link:hover,
.home-card-link:focus-visible {
  color: var(--accent-1);
  text-decoration: none;
}
.home-card-link:focus-visible {
  outline: none;
}
.home-group:has(.home-card-link:focus-visible),
.home-shot:has(.home-card-link:focus-visible) {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
}
.home-group:has(.home-card-link) {
  transition: transform 0.15s, border-color 0.15s;
}
.home-group:has(.home-card-link):hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-1-rgb), 0.35);
}
.home-group:has(.home-card-link) h3::after,
.home-shot:has(.home-card-link) b::after {
  content: " →";
  color: var(--accent-1);
  opacity: 0;
  transition: opacity 0.15s;
}
/* In the box's corner, so a long title is not pushed to a second line. */
.home-group:has(.home-card-link) h3::after {
  content: "→";
  position: absolute;
  top: 22px;
  right: 22px;
  font-size: 18px;
}
.home-group:hover h3::after,
.home-shot:hover b::after {
  opacity: 1;
}

.home-group {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 24px 20px;
  box-shadow: var(--home-shadow);
}
.home-group header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.home-group h3 {
  margin: 0;
  font-size: 18px;
}
.home-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.home-group li {
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper-alt);
  border: 1px solid var(--border);
}
.home-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: var(--home-chip);
  color: var(--accent-1);
  flex: none;
}
.home-icon svg {
  width: 22px;
  height: 22px;
}
.home-alt {
  background: var(--paper-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.home-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.home-shot {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--home-shadow);
  transition: transform 0.15s;
}
.home-shot:hover {
  transform: translateY(-3px);
}
.home-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top left;
}
.home-shot figcaption {
  padding: 14px 16px 16px;
}
.home-shot b {
  display: block;
  font-size: 15px;
}
.home-shot span {
  font-size: 14px;
  color: var(--muted);
}
.home-more {
  margin: 28px 0 0;
  text-align: right;
  font-weight: 600;
}
.home-principles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 28px;
}
.home-principles h3 {
  font-size: 17px;
  margin: 14px 0 6px;
}
.home-principles p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.home-cta {
  margin: 0 auto;
  max-width: 960px;
  border-radius: 20px;
  padding: 48px;
  text-align: center;
  color: #fff;
  background: var(--home-grad);
  box-shadow: 0 20px 60px rgba(var(--accent-2-rgb), 0.35);
}
.home-cta h2 {
  margin: 0 0 10px;
  font-size: 32px;
  color: #fff;
}
.home-cta p {
  margin: 0 0 26px;
  opacity: 0.9;
}
.home-btn-light {
  background: #fff;
  color: var(--accent-2);
}
.home-btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}
.home-btn-outline:hover {
  color: #fff;
}
@media (max-width: 900px) {
  .home-groups,
  .home-gallery,
  .home-principles,
  .home-facts .home-wrap {
    grid-template-columns: 1fr 1fr;
  }
  .home-fact:nth-child(3) {
    border-left: 0;
  }
}
@media (max-width: 600px) {
  .home-groups,
  .home-gallery,
  .home-principles {
    grid-template-columns: 1fr;
  }
  .home-cta {
    padding: 32px 20px;
  }
  .home-block {
    padding: 64px 0;
  }
}

/* The author's note on the home page — asked 2026-10-12. */
.home-note-text {
  max-width: 680px;
  font-size: 18px;
  line-height: 1.6;
}
.home-note-text p {
  margin: 0 0 16px;
}

/* The User guide's card: a chapter on each line, in bold, its sections after
   it — one more level than other pages show, and still one line a chapter. */
.post-card-chapters-deep {
  display: block;
}
.post-card-chapters-deep li {
  padding-left: 0;
  margin: 0 0 0.3rem;
  line-height: 1.5;
}
.post-card-chapters-deep li::before {
  content: none;
}
.post-card-chapters-deep .chapter {
  font-weight: 600;
  color: var(--ink);
}

/* ── Back to the top: a round button in the corner, hidden near the top ── */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--on-accent);
  background: var(--accent-grad);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(var(--accent-2-rgb), 0.1), 0 8px 24px rgba(var(--accent-2-rgb), 0.18);
  text-decoration: none;
  z-index: 50;
  transition: opacity 0.2s, transform 0.2s;
}
.to-top:hover {
  color: var(--on-accent);
  transform: translateY(-2px);
}
.to-top-hidden {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 600px) {
  /* Smaller on a phone, and nearer the corner: less of the text covered. */
  .to-top {
    right: 14px;
    bottom: 14px;
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* A picture opened over the page — layouts/partials/zoom.html. */
dialog.zoom {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  background: transparent;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: zoom-out;
  overflow: hidden;
}
dialog.zoom[open] {
  display: flex;
}
dialog.zoom::backdrop {
  background: rgba(20, 12, 10, 0.82);
  backdrop-filter: blur(3px);
  animation: zoom-fade 0.25s ease;
}
dialog.zoom.zoom-leaving::backdrop {
  opacity: 0;
  transition: opacity 0.25s ease;
}
dialog.zoom img {
  max-width: 94vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: var(--paper);
}
.zoom-caption {
  margin: 0;
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
  max-width: 80ch;
  padding: 0 1rem;
  transition: opacity 0.2s;
  animation: zoom-fade 0.35s ease;
}
dialog.zoom.zoom-leaving .zoom-caption {
  opacity: 0;
}
@keyframes zoom-fade {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  dialog.zoom img,
  dialog.zoom::backdrop,
  .zoom-caption {
    transition: none;
    animation: none;
  }
}
