/* One viewport backdrop, behind every public storefront surface. */
body[data-page] { position: relative; isolation: isolate; }
body[data-page]::before,
.zii-cosmic-nebula {
  background:
    radial-gradient(ellipse at 94% 28%, color-mix(in srgb, var(--shop-blue-ambient) 28%, transparent), transparent 49%),
    radial-gradient(ellipse at 4% 68%, color-mix(in srgb, var(--shop-red-ambient) 24%, transparent), transparent 46%),
    linear-gradient(180deg, color-mix(in srgb, var(--shop-canvas) 38%, transparent), color-mix(in srgb, var(--shop-canvas) 65%, transparent)),
    url('/assets/cosmic-space-v11.webp') 56% center / cover,
    var(--shop-canvas);
}
body[data-page]::before { content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none; }
body[data-page].zii-space-ready::before { visibility: hidden; }
.zii-cosmic-space { position: fixed; inset: 0; z-index: -1; overflow: hidden; contain: strict; pointer-events: none; user-select: none; }
.zii-cosmic-nebula { position: absolute; inset: -3%; transform-origin: center; }
.zii-cosmic-space[data-motion="active"] .zii-cosmic-nebula { will-change: transform; }
.zii-cosmic-light {
  position: absolute;
  inset: -8%;
  opacity: 0;
  background:
    radial-gradient(ellipse at 2% 72%, var(--shop-red-ambient), transparent 43%),
    radial-gradient(ellipse at 98% 30%, var(--shop-blue-ambient), transparent 48%);
}
.zii-cosmic-space:not([data-motion="active"]) .zii-cosmic-light { visibility: hidden; }
.zii-cosmic-canvas { display: block; position: relative; width: 100%; height: 100%; pointer-events: none; }
body[data-page] #main { background: transparent; }
body[data-page] #main > #catalogo,
body[data-page="lab"] #main > #card-lab { background: linear-gradient(90deg, #0b111c55, #0b111c26); }
body[data-page="home"] .hero { background: linear-gradient(90deg, #05091455, transparent 68%); }
/* Feather the photograph into the header as well as the next section. */
body[data-page="home"] .hero > .hero-arena-backdrop {
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12% 79%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 12% 79%, transparent);
}
body[data-page="home"] .hero > .hero-atmosphere {
  -webkit-mask-image: linear-gradient(180deg, #000 0 84%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0 84%, transparent 100%);
}

body[data-page="home"]::before,
body[data-page="home"] .zii-cosmic-nebula { background-position: center; }
body[data-page]:not([data-page="home"], [data-page="lab"])::before,
body[data-page]:not([data-page="home"], [data-page="lab"]) .zii-cosmic-space { opacity: .72; }
body[data-page]:is([data-page="cart"], [data-page="orders"], [data-page="contact"], [data-page="privacy"])::before,
body[data-page]:is([data-page="cart"], [data-page="orders"], [data-page="contact"], [data-page="privacy"]) .zii-cosmic-space { opacity: .46; }
@media (prefers-reduced-motion: reduce) {
  .zii-cosmic-nebula { transform: none !important; will-change: auto !important; }
  .zii-cosmic-light { display: none; }
}
body:is(.motion-off, .reduce-motion) .zii-cosmic-nebula { transform: none !important; will-change: auto !important; }
html[data-motion-paused] .zii-cosmic-light { display: none; }

/* A foreground exposure of the same sky, between the arena art and its content. */
body[data-page="home"] .hero > .zii-hero-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000 0 80%, transparent);
}
.zii-hero-stars::before, .zii-hero-stars::after {
  content: '';
  position: absolute;
  inset: -72px;
  pointer-events: none;
  background: var(--hero-stars-image) center / max(100%, 940px) auto no-repeat;
  opacity: var(--hero-stars-opacity);
  transform: var(--hero-stars-transform, none);
}
.zii-hero-stars::before {
  --hero-stars-image: url('/assets/hero-stars-far.svg');
  --hero-stars-opacity: .74;
  --hero-stars-transform: var(--hero-stars-far, none);
}
.zii-hero-stars::after {
  --hero-stars-image: url('/assets/hero-stars-near.svg');
  --hero-stars-opacity: .88;
  --hero-stars-transform: var(--hero-stars-near, none);
}
@media (max-width: 740px) {
  .zii-hero-stars::before, .zii-hero-stars::after { background-size: cover; }
}
@media (prefers-reduced-motion: reduce) {
  .zii-hero-stars::before, .zii-hero-stars::after { transform: none; }
}
html[data-motion-paused] .zii-hero-stars::before, html[data-motion-paused] .zii-hero-stars::after,
body:is(.motion-off, .reduce-motion) .zii-hero-stars::before, body:is(.motion-off, .reduce-motion) .zii-hero-stars::after { transform: none; }
@media (forced-colors: active) {
  body[data-page]::before, .zii-cosmic-space,
  .zii-hero-stars { display: none; }
}
@media (min-width: 741px) and (hover: hover) and (pointer: fine) {
  body[data-page="home"] .hero > .hero-arena-backdrop img {
    --hero-arena-crop: translateX(2.4%) scale(1.1);
    transform: var(--hero-arena-crop);
  }
}
@media (min-width: 741px) and (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  html:not([data-motion-paused]) body[data-page="home"]:not(.motion-off, .reduce-motion) .hero > .hero-arena-backdrop img {
    transform: var(--hero-arena-pan, translate3d(0, 0, 0)) var(--hero-arena-crop);
  }
}

/* Colored light spills along the edge of the arena, never across the copy. */
.zii-hero-light {
  position: absolute;
  inset: -14% -12% -12% 27%;
  pointer-events: none;
  opacity: .34;
  /* The moving layer must reach zero alpha inside all four edges. */
  -webkit-mask-image: radial-gradient(ellipse 46% 49% at 52% 50%, #000 52%, transparent 100%);
  mask-image: radial-gradient(ellipse 46% 49% at 52% 50%, #000 52%, transparent 100%);
  background:
    radial-gradient(ellipse at 75% 56%, color-mix(in srgb, var(--shop-title-blue) 56%, transparent), transparent 57%),
    radial-gradient(ellipse at 26% 86%, color-mix(in srgb, var(--shop-title-red) 43%, transparent), transparent 61%);
}
.zii-hero-light::before {
  content: '';
  position: absolute;
  inset: 24% -5% 11% 22%;
  border-radius: 50%;
  border-block-end: 1px solid #a6ceff91;
  border-block-start: 1px solid #d49f7b76;
  transform: rotate(-17deg);
  box-shadow: 0 8px 19px -18px #76b8ff, inset 0 12px 28px -27px #fbc69e;
  mask-image: radial-gradient(ellipse at 62% 66%, #000 0 35%, transparent 78%);
}
@media (max-width: 740px), (hover: none) and (max-width: 1024px) {
  .zii-hero-light { inset: 20% -27% -17%; }
  .zii-hero-light::before { inset-inline: 8%; }
}
html[data-motion-paused] .zii-hero-light,
body:is(.motion-off, .reduce-motion) .zii-hero-light {
  opacity: .34 !important;
  transform: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .zii-hero-light { opacity: .34 !important; transform: none !important; }
}

/* The two frost fields fall over the edge of the scene. The center stays open
   for product photos, text and controls, including when artwork is full bleed. */
body[data-page] > .zii-cosmic-snow {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: clip;
  contain: strict;
  pointer-events: none;
  user-select: none;
  opacity: .84;
  mask-image: linear-gradient(90deg, #000 0%, #000c 14%, #0005 29%, #0002 45% 55%, #0005 71%, #000c 86%, #000 100%);
}
.zii-cosmic-snow::before, .zii-cosmic-snow::after {
  content: '';
  position: absolute;
  inset: calc(-1 * var(--snow-cycle) - 6px) -62px 0;
  background: var(--snow-tile) 50% 0 / var(--snow-width) var(--snow-cycle) repeat;
  transform: var(--snow-pan, none);
  pointer-events: none;
}
.zii-cosmic-snow::before {
  --snow-tile: url('/assets/cosmic-snow-far.svg');
  --snow-width: 520px;
  --snow-cycle: 392px;
  --snow-pan: var(--snow-far-pan);
  opacity: .78;
}
.zii-cosmic-snow::after {
  --snow-tile: url('/assets/cosmic-snow-near.svg');
  --snow-width: 612px;
  --snow-cycle: 516px;
  --snow-pan: var(--snow-near-pan);
  opacity: .86;
}
body[data-page] > .zii-cosmic-snow[data-motion="paused"] { visibility: hidden; }
body[data-page] > .zii-cosmic-snow[data-motion="static"] { opacity: .32; }
html[data-motion-paused] .zii-cosmic-snow::before, html[data-motion-paused] .zii-cosmic-snow::after,
body:is(.motion-off, .reduce-motion) .zii-cosmic-snow::before, body:is(.motion-off, .reduce-motion) .zii-cosmic-snow::after {
  transform: none;
}
@media (max-width: 740px) {
  body[data-page] > .zii-cosmic-snow {
    mask-image: linear-gradient(90deg, #000 0%, #000c 9%, #0003 25%, #0001 42% 58%, #0003 75%, #000c 91%, #000 100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .zii-cosmic-snow::before, .zii-cosmic-snow::after { transform: none; }
}
@media (forced-colors: active) {
  body[data-page] > .zii-cosmic-snow { display: none; }
}
@supports not (mask-image: linear-gradient(#000, transparent)) {
  body[data-page] > .zii-cosmic-snow { opacity: .29; }
}

/* A few real landing flakes sit above the masked background snowfall.
   The frost itself belongs to the ledge, so it travels with the page. */
body[data-page] > .zii-snow-landings {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: clip;
  contain: strict;
  pointer-events: none;
  user-select: none;
}
.zii-snow-landing-flake {
  position: absolute;
  inset: 0 auto auto 0;
  inline-size: 4px;
  block-size: 4px;
  border-radius: 50%;
  background: #e9f4ff;
  box-shadow: 0 0 4px #b6d9fc91;
  pointer-events: none;
}
[data-snow-ledge] { position: relative; }
.zii-snow-frost {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: var(--frost-pos, 38%);
  inline-size: clamp(24px, 17%, 58px);
  block-size: 7px;
  transform: translate(-50%, -40%);
  pointer-events: none;
  user-select: none;
}
.zii-snow-frost::before,
.zii-snow-frost::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.zii-snow-frost::before {
  inset: -1px 0 1px;
  border-radius: 48% 64% 61% 45%;
  background:
    radial-gradient(1.3px 1.1px at 15% 65%, #f5fcff 54%, transparent 98%),
    radial-gradient(1px 1px at 28% 42%, #e8f7ff 55%, transparent 98%),
    radial-gradient(1.4px 1px at 40% 43%, #fff 52%, transparent 98%),
    radial-gradient(1.2px 1.3px at 52% 22%, #f7fcff 53%, transparent 99%),
    radial-gradient(1px .8px at 66% 38%, #ebf8ff 55%, transparent 99%),
    radial-gradient(1.2px 1.1px at 80% 58%, #e4f5ff 54%, transparent 98%),
    radial-gradient(ellipse at 48% 68%, #cfe7fa 0%, #799abd 29%, transparent 69%);
  opacity: var(--frost-level, 0);
  transform: scale(calc(.58 + var(--frost-level, 0) * .55), calc(.36 + var(--frost-level, 0) * .85));
  transform-origin: 50% 75%;
}
.zii-snow-frost::after {
  inset: 3px 1px -1px;
  background:
    radial-gradient(1px 1.5px at 45% 68%, #e0f6ff 20%, #8ab8d48c 57%, transparent 100%),
    radial-gradient(1px 1px at 66% 49%, #c9eeff 19%, transparent 100%),
    radial-gradient(ellipse at 49% 26%, #91b6c693 0%, #597c945e 32%, transparent 70%);
  opacity: var(--frost-wet, 0);
}
body:not(.zii-space-running) .zii-snow-landings,
body:not(.zii-space-running) .zii-snow-frost { visibility: hidden; }
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  body[data-page] > .zii-snow-landings, .zii-snow-frost { display: none; }
}
