/* The artwork of the books of abstracts on the site (user 2026-10-28/29).
 *
 * The faceted pieces (scripts/deco.mjs → /assets/img/deco/) are alpha maps: each is a CSS mask
 * over a colour token, so the facets follow the light and dark scheme and the theme switcher.
 * They are decoration only: no content, no pointer events; gone in forced colours and print.
 * The accent under page headers (rectangle 2) is in layout.css. Here, as the user chose from
 * three directions on 2026-10-29 (a ridge under the bar and a band above the footer combined;
 * teeth in the side margins dropped):
 *   - the ridge: the sticky breadcrumb bar on a light tint of the year's colour, its lower edge
 *     the top teeth, under which text fades out as it scrolls;
 *   - the band: rectangle 1 across the screen, standing on the footer.
 * The teeth wipe between pages (cross-document view transitions) was dropped on 2026-10-29: while
 * it ran, clicks on the new page were lost. */

/* ---- The ridge ------------------------------------------------------------------------- */
/* The teeth take the place and the height of the bar's plain fade (layout.css; --fade-top in
 * tokens.css), so the scroll padding that keeps focus and anchors below the bar (2.4.11) covers
 * them, and they stay lower than the main area's top padding, so at the top of a page they cover
 * nothing. The tint is light (7 % of the year's colour over white), so the bar's text keeps its
 * contrast. The teeth repeat along the bar, each copy stretched sideways 1.5 times (one copy
 * across the full width at this height would flatten them into a wave); round fits whole copies.
 * Solid for most of their height, they fade out towards their points. The home page has no bar. */
.breadcrumb-bar {
  --ridge: color-mix(in oklab, var(--year-lead) 7%, var(--paper-raised));
  --ridge-tile: calc(var(--fade-top) * 1022.53 / 232.41 * 1.5) 100%;
  --ridge-fade: linear-gradient(#000 60%, transparent);
}

.breadcrumb-bar__surface {
  background: var(--ridge);
  border-block-end-color: transparent;
}

/* The teeth's outline in the tint (the mask shorthand resets mask-composite, so intersect comes
 * after it). */
.breadcrumb-bar::after {
  background: var(--ridge);
  mask:
    url("/assets/img/deco/top-teeth-solid.svg") 0 0 / var(--ridge-tile) round no-repeat,
    var(--ridge-fade);
  mask-composite: intersect;
}

/* The facets, faintly over the outline. */
.breadcrumb-bar::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 100%;
  z-index: 1;
  block-size: var(--fade-top);
  background: var(--year-lead);
  opacity: 0.4;
  pointer-events: none;
  mask:
    url("/assets/img/deco/top-teeth.svg") 0 0 / var(--ridge-tile) round no-repeat,
    var(--ridge-fade);
  mask-composite: intersect;
}

/* With more contrast or less transparency: the teeth's outline alone, solid to their points, and
 * the bar's hairline back. */
@media (prefers-contrast: more), (prefers-reduced-transparency: reduce) {
  .breadcrumb-bar::before {
    display: none;
  }

  .breadcrumb-bar::after {
    mask: url("/assets/img/deco/top-teeth-solid.svg") 0 0 / var(--ridge-tile) round no-repeat;
  }

  .breadcrumb-bar__surface {
    border-block-end-color: var(--border);
  }
}

/* ---- The band above the footer ---------------------------------------------------------- */
/* Rectangle 1 across the full width of the screen, standing on the footer's top edge, squeezed
 * to three quarters of its drawn height (at most 5.625rem; wider screens stretch it sideways). In
 * the flow (the footer moves down by the band's height), never fixed. */
.site-footer {
  --deco-band: min(100vw * 85.26 / 1024 * 0.75, 5.625rem);
  position: relative;
  margin-block-start: var(--deco-band);
  view-timeline: --footer block;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 100%;
  block-size: var(--deco-band);
  background: var(--deco-ink);
  pointer-events: none;
  mask: url("/assets/img/deco/rectangle1.svg") 0 0 / 100% 100% no-repeat;
}

/* The band rises as the footer scrolls into view (scroll-driven; where the browser has no view
 * timelines it stands still): it is uncovered upwards from its base, never moved. Sliding it down
 * instead (until 2026-10-29) laid it over the footer's top line, which showed through the
 * translucent facets as a thin line moving with the scroll. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .site-footer::before {
      animation: deco-rise linear both;
      animation-timeline: --footer;
      animation-range: entry 0% entry 100%;
    }
  }
}

@keyframes deco-rise {
  from {
    opacity: 0.2;
    clip-path: inset(40% 0 0);
  }

  /* Explicit: inset() does not interpolate to the initial none. */
  to {
    clip-path: inset(0);
  }
}

/* ---- Forced colours and print: none of it ----------------------------------------------- */
@media (forced-colors: active), print {
  .breadcrumb-bar::before,
  .breadcrumb-bar::after,
  .site-footer::before {
    display: none;
  }

  .site-footer {
    margin-block-start: 0;
  }
}
