/* The site's frame (038 W7): the top bar and the footer of the landing, legal, 404 and notice pages,
   and the page width they share. Hand-written; colors and fonts from the tokens stylesheet. Only the
   landing runs a script, its own landing JS file: it adds .js to <html> and shows the theme button. The other
   pages follow the OS theme and have no theme button. */

[hidden] { display: none !important; }
.wrap { max-width: 72rem; margin: 0 auto; padding-inline: clamp(16px, 4vw, 2.5rem); }
.skip { position: absolute; left: -10000px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 30; background: var(--paper); padding: 0.5rem 0.8rem; font-family: var(--sans); }

/* ── Top bar: the mark and name, the section nav, GitHub, the theme button at the far right ── */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 0.6rem; height: 3.5rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-right: auto;
  font: 600 1rem/1 var(--sans);
  letter-spacing: -0.01em;
  color: var(--strong);
  text-decoration: none;
}
/* The mark (038 D3). Its circle used to fill the SVG's box edge to edge, and at 1.65rem (26.4 px) on a
   fractional line the box cut the circle's bottom and right edge flat. Now the viewBox leaves one
   unit of air around the circle and the box is a whole number of pixels. */
.mark { display: block; width: 1.75rem; height: 1.75rem; flex: none; overflow: visible; }
.nav { display: flex; gap: 1.4rem; margin-right: 0.9rem; font: 500 0.88rem/1 var(--sans); }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--strong); }
.gh-link, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 2.1rem;
  font: 500 0.85rem/1 var(--sans);
  color: var(--strong);
  background: transparent;
  text-decoration: none;
  border: 1px solid var(--pane-line);
  border-radius: 6px;
  padding: 0 0.7rem;
}
.gh-link:hover, .icon-btn:hover, .icon-btn[aria-expanded="true"] { border-color: var(--muted); }
.gh-link svg { width: 1.05em; height: 1.05em; fill: currentColor; flex-shrink: 0; }
.icon-btn { width: 2.1rem; padding: 0; cursor: pointer; }
.icon-btn svg { width: 1rem; height: 1rem; }

/* The theme button and its menu: Light, Dark, Auto. Auto (no data-theme) follows the OS and is
   the default. Without script the button is hidden and the page follows the OS. */
.theme { position: relative; }
html:not(.js) .theme { display: none; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 9.5rem;
  padding: 0.3rem;
  background: var(--card);
  border: 1px solid var(--pane-line);
  border-radius: 9px;
  box-shadow: var(--shadow);
}
.menu button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  font: 500 0.86rem/1 var(--sans);
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.menu button:hover, .menu button:focus-visible { background: var(--pane); color: var(--strong); outline: none; }
.menu button svg { width: 1rem; height: 1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu button::after { content: ''; margin-left: auto; width: 0.42rem; height: 0.42rem; border-radius: 50%; }
.menu button[aria-checked="true"] { color: var(--strong); }
.menu button[aria-checked="true"]::after { background: var(--accent); }

/* ── Footer ── */
.foot { margin-top: 3rem; border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; font: 400 0.82rem/1.6 var(--sans); color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; justify-content: space-between; align-items: center; }
.foot p { margin: 0; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--strong); }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }

@media (max-width: 480px) {
  .gh-link span { display: none; }
  .gh-link { width: 2.1rem; padding: 0; }
}
@media print {
  .top { display: none; }
}
