/* Page of the pack site: the body and .note rules of the Unisson model, selectors moved into the shadow tree,
   colours read from the --pack-* tokens. The host stands in for the model's body: the page background, the type
   settings and the clipped horizontal overflow. public/tokens.css gives body a padding of var(--space-4); the host
   cancels it with the same negative margin on every side, so the page runs edge to edge as in the model (measured:
   16 px at 1440 and 390, left, right, top and bottom). overflow-inline: clip, unlike hidden, makes no scroll container,
   so the sticky header of bythium-pack-header keeps sticking to the viewport. max-inline-size drops the cap of
   base.css, which would keep the host 32 px short of the viewport. The host is a stacking context (z-index: 0) so
   the hero's fixed aurora (z-index: -1) paints over this background, as the model's aurora over its body's. No
   motion of its own. */
:host {
  display: block;
  position: relative;
  z-index: 0;
  margin: calc(-1 * var(--space-4));
  /* The page background reaches the bottom of the window, as the model's body does, however short the page. */
  min-block-size: 100vh;
  max-inline-size: none;
  overflow-inline: clip;
  background: var(--pack-bg);
  color: var(--pack-ink);
  font:
    16px / 1.6 Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-feature-settings: normal;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
}
:host([hidden]) {
  display: none;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
/* The model's .skip link: out of sight above the page until it has the focus, then 10 px from the top, over the note
   band and the sticky header. The colours of the model, ink on the page background inverted. */
.skip {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-start: -60px;
  z-index: var(--z-skip);
  min-block-size: 0;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--pack-ink);
  color: var(--pack-bg);
  text-decoration: none;
}
.skip:focus {
  inset-block-start: 10px;
}
@media (forced-colors: active) {
  .skip {
    border: 1px solid LinkText;
  }
}
/* The sections' landmark: a plain block, the slotted sections lay out as before. The page focuses it when the
   address names content-id; the focus ring of the base sheet shows it to a keyboard reader, as in the model. */
[part="main"] {
  display: block;
}
/* The note band at the very top: it scrolls away, the sticky header stays. */
[part="note"] {
  position: relative;
  z-index: var(--z-base);
  margin: 0;
  padding: 6px 16px;
  text-align: center;
  font:
    600 12px / 1.5 ui-monospace,
    "JetBrains Mono",
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 0.02em;
  color: var(--pack-ink);
  background: linear-gradient(90deg, var(--pack-a1), var(--pack-a2), var(--pack-a3)), var(--pack-bg);
  border-block-end: 1px solid var(--pack-line);
}
@media (forced-colors: active) {
  [part="note"] {
    forced-color-adjust: auto;
    border-block-end-color: CanvasText;
  }
}

/* backdrop="calm": the aurora of the model pages outside the documentation, calmer than the home for reading
   (opacity .7), and the dotted grain, fixed behind the whole page; the rules of bythium-pack-docs. The host is a
   stacking context, so z-index -1 paints them over its background and under the sections. */
.aurora,
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.aurora {
  overflow: hidden;
  opacity: 0.7;
}
.aurora i {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.aurora i:nth-child(1) {
  inline-size: 70vmax;
  block-size: 70vmax;
  inset-inline-start: -20vmax;
  inset-block-start: -30vmax;
  background: radial-gradient(closest-side, var(--pack-a1), transparent 70%);
}
.aurora i:nth-child(2) {
  inline-size: 80vmax;
  block-size: 80vmax;
  inset-inline-end: -30vmax;
  inset-block-start: -10vmax;
  background: radial-gradient(closest-side, var(--pack-a2), transparent 70%);
}
.aurora i:nth-child(3) {
  inline-size: 70vmax;
  block-size: 70vmax;
  inset-inline-start: 20vmax;
  inset-block-end: -45vmax;
  background: radial-gradient(closest-side, var(--pack-a3), transparent 70%);
}
@keyframes drift1 {
  to {
    transform: translate3d(8vmax, 6vmax, 0) scale(1.1);
  }
}
@keyframes drift2 {
  to {
    transform: translate3d(-9vmax, 8vmax, 0) scale(0.92);
  }
}
.grain {
  opacity: 0.5;
  background-image: radial-gradient(var(--pack-line) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, var(--pack-ink), transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 20%, var(--pack-ink), transparent 70%);
}

@media (prefers-reduced-motion: no-preference) {
  .aurora i:nth-child(1) {
    animation: drift1 26s ease-in-out infinite alternate;
  }
  .aurora i:nth-child(2) {
    animation: drift2 32s ease-in-out infinite alternate;
  }
  .aurora i:nth-child(3) {
    animation: drift1 38s ease-in-out infinite alternate-reverse;
  }
}
/* Forced colours: no decorative light. */
@media (forced-colors: active) {
  .aurora,
  .grain {
    display: none;
  }
}
