NGU-Web/src/components/PageBackdrop.css
Zaldimmar 79f1d09eef Try the revised palette (teal, green, amber, ink)
The suggested grid as the theme defaults, light and dark, with
PALETTE, the accents (olive becomes amber), the backdrop shades
and every literal from the old grid mapped over. Every text pair
passes the admin's 4.5:1 check; the hero's filled button is amber.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 16:51:14 -05:00

93 lines
2.9 KiB
CSS

/* ═══════════════════════════════════════════════════════════════
PAGE BACKDROP: the circles, their layers and shades
(PageBackdrop.tsx places them)
Flat fills only: no blur, no gradient, no glow. Light mode uses
the palette's lightest teal, green and amber at 60%, dark mode
their darkest at 30% over the ink background. Every text token
reads at 4.5:1 or better on each shade even at full strength, so
however many circles overlap, text stays readable (the lowest is
4.62:1, the link teal on the light green).
═══════════════════════════════════════════════════════════════ */
.page-backdrop {
position: fixed;
inset: 0;
z-index: -1;
overflow: hidden;
pointer-events: none;
--pb-opacity: 0.6;
--pb-0: #d6f5fa;
--pb-1: #e6f0dd;
--pb-2: #fdf1d6;
--pb-3: #d6f5fa;
}
/* A circle's place: across by its left, down its layer's whole
travel (the window plus how far the layer rises), centered on
that point. */
.page-backdrop__circle {
position: absolute;
width: var(--pb-size);
height: var(--pb-size);
top: calc(var(--pb-top) * (100vh + var(--pb-scroll, 0px) * var(--pb-speed)) - var(--pb-size) / 2);
border-radius: 50%;
opacity: var(--pb-opacity);
transition: background-color 2.4s ease-in-out;
}
/* Each layer rises by its share of the page's scroll as the page
scrolls: the back slowest, none as fast as the page. */
@supports (animation-timeline: scroll()) {
.page-backdrop__circle {
animation: page-backdrop-rise linear both;
animation-timeline: scroll(root block);
}
}
/* The same rise where scroll-driven animations are missing: the
scroll position arrives as --pb-y from PageBackdrop.tsx. */
.page-backdrop[data-parallax="script"] .page-backdrop__circle {
transform: translateY(calc(var(--pb-y, 0px) * var(--pb-speed) * -1));
will-change: transform;
}
@keyframes page-backdrop-rise {
to {
transform: translateY(calc(var(--pb-scroll, 0px) * var(--pb-speed) * -1));
}
}
@media (prefers-reduced-motion: reduce) {
.page-backdrop__circle,
.page-backdrop[data-parallax="script"] .page-backdrop__circle {
animation: none;
transform: none;
}
}
/* Dark mode: the dark shades. Two blocks as in index.css: the
toggle's choice, or the system's when there is none. */
:root[data-theme="dark"] .page-backdrop {
--pb-opacity: 0.3;
--pb-0: #003a45;
--pb-1: #23361a;
--pb-2: #4a2e00;
--pb-3: #003a45;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .page-backdrop {
--pb-opacity: 0.3;
--pb-0: #003a45;
--pb-1: #23361a;
--pb-2: #4a2e00;
--pb-3: #003a45;
}
}
@media print {
.page-backdrop {
display: none;
}
}