/* Reversible newspaper palette. Media and layout retain the saved design. */
:root {
  --slate: #e8e0cf;
  --paper: #f4ecdc;
  --ink: #191815;
  --muted: #625c53;
  --sage: #294438;
  --pink: #582c2b;
  --blue: #1d4149;
  --news-rule: #82796a;
  --news-light-rule: #e8e0cf66;
  color: var(--ink);
  background-color: var(--slate);
  color-scheme: light;
  scrollbar-color: #746c60 var(--slate);
}
body { color: var(--ink); background: var(--slate); }
::selection { background: #1d4149; color: #f4ecdc; }
::-webkit-scrollbar-thumb { background: #746c60; border-color: var(--slate); }
a:focus-visible, button:focus-visible, iframe:focus-visible { outline-color: #b95525; }

/* Warm paper, black ink, and the existing printed fiber texture. */
.site-header, .opening, footer, .paper-stack .chapter-heading,
.paper-stack .sheet-surface, main .saas-heading,
.editing-heading, .collection-note, .editing-page-surface,
a.editing-link > .editing-peek {
  background-color: var(--slate);
  color: var(--ink);
}
.site-header, .opening-line, footer > div, footer,
.paper-stack .chapter-heading, main .saas-heading,
.edition-line, .editing-intro, .collection-note {
  border-color: var(--news-rule);
}
.header-location, .site-header button, .opening-line > span,
.chapter-heading p, .chapter-heading > span,
footer > div, .edition-line, .editing-intro > span,
.note-label, .availability-note { color: var(--muted); }
.footer-name:hover { color: #582c2b; }
.skip-link { background: var(--ink); color: var(--paper); }

/* Invert the pale project stock into deep green, red, and blue inks. */
.portal-real { background-color: var(--sage); color: var(--paper); }
.portal-print { background-color: #b7caaa; }
.portal-digital { background-color: var(--blue); color: var(--paper); }
.portal-digital .portal-period { color: var(--paper); }
.portal-digital .finch-flight path { stroke: #bed5c5; }
.portal-digital .finch-flight ellipse { fill: #bed5c5; }
.project-reference .scene-caption { background-color: var(--sage); color: var(--paper); }
.reference-art .reference-print-title,
main .reference-drone-art .reference-print-title {
  background-color: var(--paper);
  color: var(--ink);
}
.project-totaldamage, .damage-art { background-color: var(--pink); color: var(--paper); }
.damage-lettering span:nth-child(2) { color: #eed2bb; }
.damage-lettering span:nth-child(3) { color: #e8bca3; }
.damage-statement { color: var(--paper); }
.project-totaldamage .scene-caption { background-color: #452422; color: var(--paper); }
.finch-orbit { background-color: var(--blue); }
.finch-orbit .finch-flight path { stroke: #bed5c5; }
.finch-orbit .finch-flight ellipse { fill: #bed5c5; }
.object-rings { background-color: var(--sage); }
.object-host { background-color: var(--blue); }

/* The original cream clippings read as loose paper on the darker bio sheet. */
.paper-stack .sheet-surface.about { background-color: var(--sage); color: var(--paper); }
.sheet-bio .bio-news article, .sheet-bio .award-count { color: var(--ink); }
.sheet-bio .bio-news article h3 { border-color: var(--news-rule); }
.sheet-bio .bio-news article::before { background-color: var(--paper); }
.sheet-bio .bio-news article:nth-child(2)::before { background-color: #e8e0cf; }
.sheet-bio .bio-news article:nth-child(4)::before { background-color: #f4ecdc; }
.sheet-bio .bio-facts { border-color: var(--news-light-rule); }
.accent-expression { background-color: #673f36; }
.accent-fabric { background-color: #253e47; }
.accent-profile { background-color: #3a4c34; }
.accent figcaption { background-color: #191815; color: var(--paper); }

/* Keep the two words identical in size and ink, including the moving highlight. */
main .saas-heading h2 em { color: var(--ink); }
@media(prefers-reduced-motion:no-preference) {
  body:not(.motion-paused) .saas-heading h2 em {
    background-image: linear-gradient(110deg,#191815 0%,#191815 42%,#746c60 47%,#9c8e78 49%,#191815 54%,#191815 100%);
    color: transparent;
  }
}

/* The editing sheet opens from dark ink into the light newspaper archive. */
a.editing-link { background-color: #252520; color: var(--paper); border-color: #82796a; }
a.editing-link:hover { background-color: #34342c; }
.film, .film:nth-child(3n+2), .film:nth-child(3n) { color: var(--paper); }
.film { background-color: var(--sage); }
.film:nth-child(3n+2) { background-color: var(--blue); }
.film:nth-child(3n) { background-color: var(--pink); }

/* Reference Imaging's pale story paper becomes forest stock. */
#project-dialog[data-project=reference] {
  --case-bg: #294438;
  --case-ink: #f4ecdc;
  --case-muted: #d3dcc7;
  --ri-rule: #e8e0cf66;
  --ri-forest: #1e342a;
  color-scheme: dark;
}
#project-dialog[data-project=reference] .ri-booking-viewer { color: var(--paper); }
#project-dialog[data-project=reference] .dialog-toolbar,
#project-dialog[data-project=reference] .project-intro,
#project-dialog[data-project=reference] .project-ending,
#project-dialog[data-project=reference] .service-list a { border-color: var(--ri-rule); }
@media(forced-colors:active) {
  main .saas-heading h2 em { background: none !important; color: CanvasText !important; }
}

/* The title is punched through the whole colored sheet, revealing the page below. */
.world-portal h2 {
  color: transparent;
  -webkit-text-stroke: 0;
  filter: none;
  background: var(--slate) var(--paper-grain);
  background-size: 180px;
  background-clip: text;
  -webkit-background-clip: text;
}
.world-portal h2 .portal-period { color: transparent; }
.world-portal h2 em { color: var(--paper); -webkit-text-stroke: 0; }
.world-portal.has-paper-cutout {
  mask-image: url('assets/paper-edge.svg'), var(--title-cutout);
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
  mask-composite: intersect;
  -webkit-mask-image: url('assets/paper-edge.svg'), var(--title-cutout);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-composite: source-in;
}
.world-portal.has-paper-cutout h2 { background: none; }
.portal-sheet { filter: drop-shadow(0 2px 1px #14171040) drop-shadow(0 10px 12px #19181530); }
@media(forced-colors:active) {
  .world-portal.has-paper-cutout { mask: none; -webkit-mask: none; }
  .world-portal h2, .world-portal h2 .portal-period, .world-portal h2 em {
    color: CanvasText;
    background: none;
    -webkit-text-stroke: 0;
    filter: none;
  }
}
