html[data-phase-theme] {
  --canvas-tile: url("/assets/archive-paper/arches-canvas-light.webp");
  --article-tile: url("/assets/archive-paper/arches-paper-light.webp");
  --sheet-shadow: inset 0 1px 0 rgb(255 255 255 / .88), 0 2px 8px rgb(53 40 19 / .08);
}
html[data-phase-theme="dark"] {
  --canvas-tile: url("/assets/archive-paper/arches-canvas-dark.webp");
  --article-tile: url("/assets/archive-paper/arches-paper-dark.webp");
  --sheet-shadow: inset 0 1px 0 rgb(243 241 236 / .12), 0 2px 8px rgb(0 0 0 / .26);
}
/* The deepest fibres of the canvas need a slightly darker secondary ink. */
html[data-phase-theme] .phase-content { --text-muted: var(--canvas-muted); }
/* Four finished colour plates, each painted once on its own surface at native size. */
html[data-phase-theme] body,
html[data-phase-theme] body :is(.phase-content,.atlas-shell,.phase-home-portal,.s2-guide),
html[data-phase-theme] body.s2-guide {
  background-color: var(--bg-canvas);
  background-image: var(--canvas-tile);
  background-size: 512px 512px;
  background-repeat: repeat;
}
html[data-phase-theme] :is(#atlas-main,main) :is(
  .phase-home-object,.bottle-atlas,.guide-reader__body>section,.s2-sidebar,.z64-sidebar-inner,
  .z64-steps,.s2-steps,.alttp-search-steps,.s2-boss,.z64-boss,.alttp-boss,.series-boss,.alttp-search-answer,
  .archive-article__body,.archive-article__facts,.ed-legend-card,.ed-blog-card,.ed-comparisons,.ed-verdict,
  .journal-hints,.journal-card,.series-chapter,.series-contents,.series-progress,.series-card,.edition-card,
  .companion-current,.companion-next,.companion-backup,.cp-card,.cp-feature,.cp-choices,.fa-card,.fa-empty,
  .nl-subscribe,.nl-preview,.forum-panel,.guide-bar,.alttp-workbench
),
html[data-phase-theme] body main.system-page {
  --text-muted: var(--sheet-muted);
  background-color: var(--bg-paper);
  background-image: var(--article-tile);
  background-size: 512px 512px;
  background-repeat: repeat;
  border: 1px solid var(--border-hairline);
  box-shadow: var(--sheet-shadow);
}
html[data-phase-theme] :is(#atlas-main,main) :is(.s2-boss,.z64-boss,.series-boss,.alttp-boss) { border-inline-start: 3px solid var(--accent-ruby); }
html[data-phase-theme] .guide-reader[data-bottle-guide] {
  --guide-gold: var(--reading-link);
  --guide-link: var(--reading-link);
}
html[data-phase-theme] .guide-reader__body .bottle-atlas { --atlas-blue: var(--reading-link); }
html[data-phase-theme] .guide-reader .guide-tabs a:is([aria-selected="true"],:hover) { color: var(--reading-link); }
html[data-phase-theme] .pz-guide-layout :is(.pz-left,.pz-mobile-chapters,.pz-right) a:is(:hover,:focus-visible,[aria-current]),
html[data-phase-theme] .pz-guide-layout .pz-map-link,
html[data-phase-theme] .guide-reader .pz-mobile-toc a { color: var(--reading-link); }
html[data-phase-theme] .guide-reader .cabinet-note {
  margin: 18px 0;
  border-inline-start: 2px solid #a98340;
  padding: 3px 12px 4px;
}
.cabinet-note > strong { color: var(--text-muted); font: 600 .84rem/1.4 var(--phase-sans); }
.cabinet-note > p { margin: .35em 0 0; }
.cabinet-note--edition > strong { color: var(--reading-link); }
html[data-phase-theme] .guide-reader .cabinet-note--edition { border-color: var(--accent-shield); }
html[data-phase-theme] .guide-reader .cabinet-note--pitfall { border-color: var(--accent-ruby); }
@media (forced-colors: active) {
  html[data-phase-theme] {
    --canvas-tile: none;
    --article-tile: none;
    --sheet-shadow: none;
  }
  html[data-phase-theme] body { background-image: none; }
}
