/* A sale with a look of its own (engine/billing/sale/config.ts `look`; engine/site/home-sale.ts): one contained card that always contrasts the ground it stands on
   (never the accent on the accent): the sale's own ground on a light page (the bar on the selling pages), a light card inside a hero (the home page's band,
   `data-sale-ground="hero"`). The price she pays in the brand's display face, a seal with the saving, the sale's own words. Any look draws in the brand's own
   colours (its site sheet's --accent, --accent-hover, --ink and --paper); a look with a palette of its own sets the --sale-* tokens below ("night": deep navy into
   blue). Nothing moves but transform and opacity, once, as the page arrives; both are in the page as it is served, so nothing shifts. */
[data-sale-look] {
  --sale-ground: var(--accent, #3b3170); --sale-ground-to: var(--accent-hover, var(--accent, #2f2760)); --sale-words: #fff; --sale-was: rgba(255, 255, 255, .78);
  --sale-seal: #fff; --sale-seal-words: var(--accent, #3b3170); --sale-go: #fff; --sale-go-words: var(--accent, #3b3170); --sale-focus: #fff;
  --sale-card: var(--paper, #fff); --sale-card-words: var(--ink, #1d1a21); --sale-card-was: var(--muted, #5f5a66); --sale-card-mark: var(--accent, #3b3170);
  --sale-shadow: rgba(0, 0, 0, .35);
}
[data-sale-look="night"] {
  --sale-ground: #06143a; --sale-ground-to: #0a4fc4; --sale-words: #f3f7ff; --sale-was: #b9cbee; --sale-seal: #fff; --sale-seal-words: #06143a; --sale-go: #fff;
  --sale-go-words: #06143a; --sale-focus: #9cc4ff; --sale-card: #fff; --sale-card-words: #0b2a5e; --sale-card-was: #566783; --sale-card-mark: #06143a; --sale-shadow: rgba(6, 20, 58, .7);
}
[data-sale-look] { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem 1rem; margin: 0 0 1.75rem; padding: 1rem 1.1rem; border-radius: 18px; text-align: center; font-size: .95rem; line-height: 1.4; color: var(--sale-words); background: var(--sale-ground); background-image: linear-gradient(120deg, var(--sale-ground) 0%, var(--sale-ground-to) 100%); box-shadow: 0 18px 40px -24px var(--sale-shadow); }
[data-sale-look]::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .85;
  background-image: radial-gradient(1.2px 1.2px at 8% 30%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 19% 72%, #fff 50%, transparent 51%), radial-gradient(1.4px 1.4px at 33% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 47% 80%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 62% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 74% 66%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 88% 28%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 95% 78%, #fff 50%, transparent 51%);
  animation: sale-look-sky 5.2s ease-in-out 3 alternate; }
[data-sale-look] p { margin: 0; font-weight: 500; text-wrap: balance; color: inherit; }
/* The words a line each (engine/site/home-sale.ts `lines`): the event, the first payment with the struck price beside it, then the end and the time left
   to it, smaller, in the band's own ink (founder 2026-11-23: the end and the clock must be clearly readable). */
[data-sale-look] .sale-line { display: block; }
[data-sale-look] .sale-line:first-child { font-weight: 600; font-size: 1.05em; }
[data-sale-look] .sale-line:nth-child(n+3) { font-size: .9em; color: var(--sale-words); }
[data-sale-look] .sale-now { font-family: var(--serif, Georgia, serif); font-weight: 600; font-size: 1.25em; line-height: 1; color: var(--sale-words); animation: sale-look-fade .5s ease-out .15s both; }
[data-sale-look] .sale-was { margin-left: .3em; color: var(--sale-was); text-decoration-thickness: 1.5px; font-variant-numeric: tabular-nums; }
/* The saving, the first thing the eye lands on (founder 2026-11-23: "not that visible or looks blurry / pixelated" in Firefox): real text, upright, in the
   brand's sans at a weight its font ships (Figtree 400 to 700, so no synthesized bold), its own size on whole pixels, high contrast; it fades in, it never turns
   or scales (a rotated or scaled layer is drawn as a bitmap, soft in Firefox). */
[data-sale-look] .sale-seal { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border-radius: 10px; background: var(--sale-seal); color: var(--sale-seal-words); font-family: var(--sans, system-ui, sans-serif); font-weight: 700; font-size: 24px; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; animation: sale-look-fade .4s ease-out both; }
[data-sale-look] .sale-seal:empty { display: none; }
/* A live countdown to the sale's end (engine/billing/sale/config.ts `countdown`, engine/site/sale-clock.ts): its figures hold their width as they tick
   (tabular, two places at least), so nothing moves. */
[data-sale-look] .sale-clock { white-space: nowrap; }
[data-sale-look] .sale-clock b { display: inline-block; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
/* A countdown sale's one bar (engine/site/home-sale.ts saleTopBar): a thin strip the window's width above the header, on the sale's ground, flat (no card, sky
   or shadow); one line where it fits, the line over the clock and the button where it doesn't; the whole strip one link, its button the link's label. It
   scrolls away with the page; the header stays where the page keeps it. */
.sale-top[data-sale-look] { display: block; margin: 0; padding: 0; border-radius: 0; overflow: visible; isolation: auto; text-align: center; background: var(--sale-ground); background-image: none; box-shadow: none; }
.sale-top[data-sale-look]::before { content: none; }
.sale-top-go { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; min-height: 44px; padding: 8px var(--gutter, 16px); color: var(--sale-words); text-decoration: none; }
.sale-top-go .sale-clock { flex: none; margin: 0; }
.sale-top-btn { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; background: var(--sale-go); color: var(--sale-go-words); font-weight: 600; white-space: nowrap; }
.sale-top-go:focus-visible { outline: 3px solid var(--sale-focus); outline-offset: -5px; }
@media (max-width: 719px) { .sale-top-line { flex: 0 0 100%; } }
/* A phone's menu opens under the header wherever the header is, the bar above it or scrolled away (where the browser can anchor it). */
@supports (anchor-name: --a) { @media (max-width: 599px) { body:has(> .sale-top) .pop { top: calc(anchor(bottom) + 14px); } } }
/* Its one button, the same on the band and the bar whatever the page's own primary button looks like. */
main [data-sale-look] :is(.btn.btn-primary, .sale-bar-go) { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1.15rem; border: 0; border-radius: 999px; background: var(--sale-go) !important; background-image: none !important; color: var(--sale-go-words) !important; font-weight: 650; font-size: .95rem; text-decoration: none; text-shadow: none; white-space: nowrap; box-shadow: none; transition: transform .16s ease, box-shadow .16s ease; }
main [data-sale-look] :is(.btn.btn-primary, .sale-bar-go)::before, main [data-sale-look] :is(.btn.btn-primary, .sale-bar-go)::after { content: none; }
main [data-sale-look] :is(.btn.btn-primary, .sale-bar-go):hover { transform: translateY(-1px); box-shadow: 0 0 0 4px rgba(255, 255, 255, .22); }
main [data-sale-look] :is(.btn.btn-primary, .sale-bar-go):focus-visible { outline: 3px solid var(--sale-focus); outline-offset: 2px; }
/* A phone: the button under the words, full width, its label centred (the grid further down places the rest). */
@media (max-width: 719px) {
  main [data-sale-look]:not(.sale-top) :is(.btn.btn-primary, .sale-bar-go) { flex: 1 0 100%; justify-content: center; }
}
@media (min-width: 720px) {
  [data-sale-look] { flex-wrap: nowrap; justify-content: flex-start; gap: 1rem; padding: .9rem 1.25rem; text-align: left; }
  [data-sale-look] p { flex: 1; text-wrap: pretty; }
  [data-sale-look] .sale-seal { min-height: 52px; padding: 0 14px; font-size: 28px; }
}
/* Inside a hero (the home page): a light card over the hero's ground, its ink the brand's, its seal and button in the sale's mark. In the hero's own flow under
   the header, so the header stays as the hero draws it and nothing is covered. */
[data-sale-look][data-sale-ground="hero"] { z-index: 2; width: min(100% - 2rem, 46rem); margin: .75rem auto 0; color: var(--sale-card-words); background: var(--sale-card); background-image: none; box-shadow: 0 22px 48px -22px var(--sale-shadow); }
[data-sale-look][data-sale-ground="hero"]::before { content: none; }
[data-sale-look][data-sale-ground="hero"] p { color: var(--sale-card-words); text-shadow: none; }
[data-sale-look][data-sale-ground="hero"] .sale-now { color: var(--sale-card-mark); }
[data-sale-look][data-sale-ground="hero"] .sale-was { color: var(--sale-card-was); }
[data-sale-look][data-sale-ground="hero"] .sale-line:nth-child(n+3) { color: var(--sale-card-words); }
[data-sale-look][data-sale-ground="hero"] .sale-seal { background: var(--sale-card-mark); color: var(--sale-card); }
main [data-sale-look][data-sale-ground="hero"] .btn.btn-primary { background: var(--sale-card-mark) !important; color: var(--sale-card) !important; }
main [data-sale-look][data-sale-ground="hero"] .btn.btn-primary:hover { box-shadow: 0 0 0 4px rgba(0, 0, 0, .12); }
main [data-sale-look][data-sale-ground="hero"] .btn.btn-primary:focus-visible { outline-color: var(--sale-card-mark); }
@keyframes sale-look-sky { from { opacity: .35; } to { opacity: .9; } }
@keyframes sale-look-fade { from { opacity: 0; } to { opacity: 1; } }
/* A later page view in the same browser session (engine/site/sale-pop.ts marks the band data-sale-seen; the founder's decision of 2026-11-25, S-15): the figure and the
   price the server wrote stand from the first paint, with no fade and no count. */
[data-sale-look][data-sale-seen] .sale-now, [data-sale-look][data-sale-seen] .sale-seal { animation: none; }
@media (prefers-reduced-motion: reduce) {
  [data-sale-look]::before, [data-sale-look] .sale-now, [data-sale-look] .sale-seal { animation: none; }
  main [data-sale-look] :is(.btn.btn-primary, .sale-bar-go) { transition: none; }
}
/* The band as a special offer (founder Mikko 2026-11-23: "maybe the banner itself could pop out more so its more special discount, or the discount have
   some effect around it? does it like count up from 0 to -45% and 'pop' when page opens"). The look is the one above, the upright seal and the lines; added:
   - the time left, the words' last line, under the end's date (engine/site/home-sale.ts clockOf), both in the band's own ink: clearly readable;
   - presence: the hero's card wears a ring in the sale's own colours (a gradient on its border box) and a deeper shadow; the bar a fine light rim;
   - the seal: larger, a soft halo round it (a ring and a glow, drawn once, never animated), and a light that sweeps across it every 5 s (one layer, moved
     by transform alone);
   - as the page opens the figure counts up from 0 to the server's own figure in 0.8 s and the seal pops once (engine/site/sale-pop.ts marks it .sale-pop:
     scale 1 to 1.08 and back, ending on no transform, so the text is drawn sharp again in Firefox).
   For reduced motion: the final figure, no count, no pop, no sweep. */
[data-sale-look] { --sale-ring: var(--accent-hover, var(--accent, #2f2760)); --sale-halo: rgba(255, 255, 255, .5); --sale-halo-ring: rgba(255, 255, 255, .22); --sale-shine: rgba(59, 49, 112, .16); --sale-card-halo: rgba(59, 49, 112, .45); --sale-card-halo-ring: rgba(59, 49, 112, .12); }
[data-sale-look="night"] { --sale-ring: #7db4ff; --sale-halo: rgba(156, 196, 255, .6); --sale-halo-ring: rgba(255, 255, 255, .24); --sale-shine: rgba(10, 79, 196, .2); --sale-card-halo: rgba(10, 79, 196, .5); --sale-card-halo-ring: rgba(10, 79, 196, .14); }
[data-sale-look]:not(.sale-top) { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .3), 0 20px 44px -22px var(--sale-shadow); }
[data-sale-look][data-sale-ground="hero"] { border: 2px solid transparent; background: linear-gradient(var(--sale-card), var(--sale-card)) padding-box, linear-gradient(120deg, var(--sale-ground) 0%, var(--sale-ground-to) 55%, var(--sale-ring) 100%) border-box; box-shadow: 0 0 0 4px rgba(255, 255, 255, .38), 0 26px 54px -20px var(--sale-shadow); }
[data-sale-look] .sale-now { font-size: 1.4em; }
[data-sale-look] .sale-line.sale-clock { font-weight: 600; white-space: normal; }
[data-sale-look] .sale-line.sale-clock b { font-weight: 700; }
[data-sale-look] .sale-seal { position: relative; overflow: hidden; min-height: 48px; padding: 0 14px; border-radius: 12px; font-size: 28px; box-shadow: 0 0 0 4px var(--sale-halo-ring), 0 8px 22px -6px var(--sale-halo); }
[data-sale-look][data-sale-ground="hero"] .sale-seal { background: var(--sale-card-mark) linear-gradient(135deg, var(--sale-card-mark) 30%, var(--sale-ground-to) 130%); box-shadow: 0 0 0 4px var(--sale-card-halo-ring), 0 8px 22px -6px var(--sale-card-halo); }
[data-sale-look] .sale-seal::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%; pointer-events: none; opacity: 0; background: linear-gradient(100deg, transparent, var(--sale-shine), transparent); transform: translate3d(-130%, 0, 0) skewX(-18deg); }
[data-sale-look][data-sale-ground="hero"] .sale-seal::after { background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent); }
@media (min-width: 720px) { [data-sale-look] .sale-seal { min-height: 56px; padding: 0 16px; font-size: 32px; } }
/* A phone: one centred column, so the card stands balanced over its full-width button at any width and in any language (founder 2026-11-24: the seal
   and the words beside it left "a lot of empty space on the right"). The seal and the event's name side by side as one lockup in the middle, then the
   first payment, the end and the time left, a line each, centred (a long one wraps into even lines), the button last. The outer columns share what the
   lockup leaves, so it sits in the middle with the seal or without it (no struck price: no seal). The words' lines are the grid's own items (the
   paragraph stays in the page for a reader, without a box). */
@media (max-width: 719px) {
  [data-sale-look]:not(.sale-top) { display: grid; grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr); grid-template-areas: ". seal name ." "price price price price" "date date date date" "clock clock clock clock" "go go go go"; gap: 2px 0; align-items: center; text-align: center; }
  [data-sale-look]:not(.sale-top) p { display: contents; }
  [data-sale-look]:not(.sale-top) .sale-seal { grid-area: seal; margin-inline-end: 14px; }
  [data-sale-look]:not(.sale-top) .sale-line:nth-child(1) { grid-area: name; text-align: start; }
  [data-sale-look]:not(.sale-top) .sale-line:nth-child(2) { grid-area: price; margin-top: 12px; }
  [data-sale-look]:not(.sale-top) .sale-line:nth-child(3) { grid-area: date; margin-top: 8px; }
  [data-sale-look]:not(.sale-top) .sale-line.sale-clock { grid-area: clock; }
  main [data-sale-look]:not(.sale-top) :is(.btn.btn-primary, .sale-bar-go) { grid-area: go; margin-top: 12px; }
}
@keyframes sale-shine { 0% { opacity: 0; transform: translate3d(-130%, 0, 0) skewX(-18deg); } 3% { opacity: 1; } 19% { opacity: 1; transform: translate3d(330%, 0, 0) skewX(-18deg); } 22%, 100% { opacity: 0; transform: translate3d(330%, 0, 0) skewX(-18deg); } }
@keyframes sale-pop { 0% { transform: scale(1); } 38% { transform: scale(1.08); } 68% { transform: scale(.985); } 100% { transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  [data-sale-look] .sale-seal::after { animation: sale-shine 5s ease-in-out 1.8s infinite; }
  [data-sale-look] .sale-seal.sale-pop { animation: sale-pop .5s cubic-bezier(.3, .7, .3, 1); }
}
