/* Living black: one quiet background layer for the shop, the cabinet and the staff panel.
   Slow drifting warm light, film grain, a soft light that follows the pointer, and a glow on
   panels under the pointer. Only transform/opacity animate; reduced motion keeps it still. */
.amb{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden;contain:strict}
#app{position:relative;z-index:1}
.amb-glow{position:absolute;border-radius:50%;filter:blur(90px);will-change:transform}
.amb-glow.g1{width:60vmax;height:60vmax;left:-22vmax;top:-26vmax;background:radial-gradient(circle,rgba(236,232,223,.15),transparent 62%);animation:amb-a 34s ease-in-out infinite alternate}
.amb-glow.g2{width:52vmax;height:52vmax;right:-20vmax;top:24vh;background:radial-gradient(circle,rgba(176,160,132,.16),transparent 62%);animation:amb-b 41s ease-in-out infinite alternate}
.amb-glow.g3{width:46vmax;height:46vmax;left:18vw;bottom:-30vmax;background:radial-gradient(circle,rgba(214,209,198,.11),transparent 62%);animation:amb-c 47s ease-in-out infinite alternate}
@keyframes amb-a{50%{transform:translate(18vw,12vh) scale(1.12)}to{transform:translate(32vw,4vh) scale(.94)}}
@keyframes amb-b{50%{transform:translate(-16vw,-14vh) scale(.9)}to{transform:translate(-6vw,18vh) scale(1.1)}}
@keyframes amb-c{50%{transform:translate(14vw,-10vh) scale(1.08)}to{transform:translate(-12vw,-4vh) scale(.96)}}
.amb-light{position:absolute;inset:0;opacity:0;transition:opacity .6s ease;
  background:radial-gradient(560px circle at var(--mx,50%) var(--my,30%),rgba(236,232,223,.085),transparent 62%)}
.amb.lit .amb-light{opacity:1}
.amb-grain{position:absolute;inset:-60%;opacity:.055;animation:amb-grain 1s steps(6) infinite;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-size:180px}
@keyframes amb-grain{0%{transform:translate(0,0)}20%{transform:translate(-3%,2%)}40%{transform:translate(2%,-4%)}60%{transform:translate(-5%,-1%)}80%{transform:translate(4%,3%)}100%{transform:translate(0,0)}}
.amb-dust{position:absolute;inset:0;width:100%;height:100%}
.amb-vignette{position:absolute;inset:0;background:radial-gradient(ellipse 120% 90% at 50% 40%,transparent 55%,rgba(0,0,0,.55))}
/* Staff panel: the same light, a touch quieter, so tables stay calm to read. */
.admin-body .amb-glow{opacity:.75}
.admin-body .amb-grain{opacity:.04}
/* Stat tiles: separators drawn per tile, so a short last row leaves no grey block behind. */
.stats{gap:0;background:rgba(0,0,0,.6)}
.stat{box-shadow:1px 0 0 var(--seam),0 1px 0 var(--seam)}
.admin-body .sidebar{background:rgba(0,0,0,.55);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}

/* Glow on surfaces under the pointer (positions come from ambient.js as --gx/--gy). */
:is(.panel,.account-card,.cab-order,.inventory-card,.cab-stats>div,.stat,.home-block,.searchbox,.select-trigger){
  background-image:radial-gradient(420px circle at var(--gx,-500px) var(--gy,-500px),rgba(236,232,223,.065),transparent 42%);
  transition:border-color .3s ease,box-shadow .4s ease}
:is(.panel,.account-card,.cab-order,.inventory-card,.cab-stats>div,.home-block):hover{border-color:var(--seam-2);box-shadow:0 0 0 1px rgba(236,232,223,.03),0 18px 60px -30px rgba(236,232,223,.18)}
/* Product photos glow softly from behind on hover. */
.card-frame{transition:box-shadow .6s ease}
@media(hover:hover) and (pointer:fine){.product-card:hover .card-frame,.category-tile:hover{box-shadow:0 24px 70px -28px rgba(236,232,223,.28)}}
/* Section titles: a thin light line that grows under them when they come into view. */
.section-head h2,.admin-heading h1{position:relative}
.section-head h2::after,.admin-heading h1::after{content:"";position:absolute;left:0;bottom:-.14em;width:100%;height:1px;background:linear-gradient(90deg,rgba(236,232,223,.5),transparent);transform:scaleX(0);transform-origin:left;transition:transform 1.4s cubic-bezier(.2,.8,.2,1) .2s}
.section-head h2.lit::after,.admin-heading h1.lit::after{transform:scaleX(1)}
/* Footer and service strip: light shows through. */
.footer,.service{background:linear-gradient(180deg,rgba(0,0,0,.25),rgba(0,0,0,.6))}

@media(prefers-reduced-motion:reduce){.amb-dust{display:none}.amb-glow,.amb-grain{animation:none}.amb-light{display:none}.section-head h2::after,.admin-heading h1::after{transition:none}}
@media(hover:none){.amb-light{display:none}}
/* Phones and tablets (iPhone Safari especially): big blurred layers and moving SVG grain are repainted
   every frame and make the first screen stutter, so there the light stays still and unblurred (the
   gradients are soft already), the grain stands still and only covers the screen, and no dust is drawn. */
@media(hover:none),(pointer:coarse){.amb .amb-glow{filter:none;animation:none;will-change:auto}.amb .amb-grain{inset:0;animation:none}}
