/* =====================================================================
   CÔTE DE NUITS · atlas + the world layer — only what js/atlas.js and js/world/layer.js render themselves:
   the canvas host, the old renderer's dusk grade, the stills fallback, the cellar backdrops, the flood and the
   ?screen=atlas dev harness. Owner: E1.
   ===================================================================== */
.at{position:absolute;inset:0;overflow:hidden;overflow:clip;background:#141026;contain:strict}
.at-host{position:absolute;inset:0;transition:opacity 1.6s var(--ease-out)}
.at.is-loading .at-host{opacity:0}
.at-cv{position:absolute;left:0;top:0;display:block;transform:translateZ(0)}
/* the old renderer's Satin Noir grade: a burgundy dusk over the painting (engine 2 grades inside its post pass) */
.at-tint{position:absolute;inset:0;pointer-events:none;background:rgba(120,52,62,.30);mix-blend-mode:multiply}
.at-grade{position:absolute;inset:0;pointer-events:none;
  background:
    radial-gradient(120% 95% at 50% 46%, rgba(9,2,4,0) 52%, rgba(9,2,4,.55) 82%, rgba(9,2,4,.88) 100%),
    linear-gradient(180deg, rgba(110,52,30,.10) 0%, rgba(9,2,4,0) 30%, rgba(9,2,4,0) 70%, rgba(9,2,4,.35) 100%)}
.at.is-3d .at-tint,.at.is-bare .at-tint,.at.is-bare .at-grade{display:none}
/* a painted arrival scene (2D fallback only) */
.at-scene{position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .9s var(--ease-out)}
.at-scene.is-on{opacity:1;transition:opacity 2.2s var(--ease-out) .15s}
.at-scene-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}

/* ---------------- the world layer (OP.world) ---------------- */
#op-world{background:#141026}
#op-world.is-off .at-host{visibility:hidden}
#op-backdrop{--ow-blur:0px;--ow-dim:0}
.ow-stills,.ow-bds{position:absolute;inset:0}
/* stills: the step's painting stands in for the world (no WebGL, or the context was lost) */
.ow-stills,.ow-stillveil{display:none}
#op-backdrop.is-stills .ow-stills,#op-backdrop.is-stills .ow-stillveil{display:block}
/* the placeholder: the same layer over the world until its first frames are in (a reloaded iPad), then a crossfade */
#op-backdrop.is-ph .ow-stills,#op-backdrop.is-ph .ow-stillveil{display:block}
#op-backdrop.is-ph .ow-stills{transition:opacity 1.2s ease}
#op-backdrop.is-ph-out .ow-stills,#op-backdrop.is-ph-out .ow-stillveil{opacity:0}
/* …at a painted hold the placeholder is the hold's own plate (js/world/plates.js cover(): .has-plate, --ow-plate), not
   the step's old painting, and it outlasts the placeholder until the world's plate is up (then .is-plate-out): the
   world takes over from the same picture. The old one never shows */
#op-backdrop.has-plate:not(.is-stills) .ow-stills{display:block;opacity:1;transition:opacity .9s ease}
#op-backdrop.has-plate:not(.is-stills) .ow-stillveil{display:block;opacity:calc(var(--ow-dim) * 1.6);transition:opacity .9s ease}
#op-backdrop.has-plate.is-plate-out:not(.is-stills) .ow-stills,#op-backdrop.has-plate.is-plate-out:not(.is-stills) .ow-stillveil{opacity:0}
#op-backdrop.has-plate:not(.is-stills) .ow-still{visibility:hidden}
/* softened and darkened like the world under a soft mood (layer.js sets --ow-blur, --ow-dim; matched to post.js'
   soft focus and dim at the names: ×2.6 the blur, ×1.6 the veil); grown by the blur so its edge stays full */
#op-backdrop.has-plate:not(.is-stills) .ow-stills::before{content:"";position:absolute;inset:calc(-2.6 * var(--ow-blur));background:var(--ow-plate) 50% 50%/cover no-repeat;
  filter:blur(calc(2.6 * var(--ow-blur)));opacity:0;transition:opacity 1.2s ease}
#op-backdrop.has-plate.is-plate-in:not(.is-stills) .ow-stills::before{opacity:1}
/* (the gate: the dark stage itself, its arch shows the painting) */
#op-backdrop.has-plate.is-plate-dark:not(.is-stills) .ow-stills{background:#141026}
.ow-stillveil{position:absolute;inset:0;background:#090204;opacity:var(--ow-dim);transition:opacity 1.2s ease}
.ow-still img{filter:blur(var(--ow-blur))}
.ow-still,.ow-bd{position:absolute;inset:0;opacity:0;transition:opacity var(--ow-dur,900ms) ease}
.ow-still.is-in,.ow-bd.is-in{opacity:1}
/* the slow 2 % push-in lives on a wrapper; a blurred image itself never animates */
.ow-drift{position:absolute;inset:-1%;transform-origin:50% 56%;animation:ow-drift 48s cubic-bezier(.2,.5,.3,1) forwards;will-change:transform}
.ow-drift img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
@keyframes ow-drift{from{transform:scale(1)}to{transform:scale(1.02)}}
.ow-bd.is-soft img{filter:blur(16px);transform:scale(1.06)}
/* no painting yet: warm table light rising from below over the soft world */
.ow-bd.is-missing{background:radial-gradient(70% 55% at 50% 112%,rgba(234,150,80,.26),transparent 70%),linear-gradient(180deg,rgba(20,16,38,.32),rgba(9,2,4,.5))}
.ow-bd.is-missing img{display:none}
/* the flood: warm light from a point to the whole stage, over the paintings */
.ow-flood{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.ow-flood>i{position:absolute;left:0;top:0;width:0;height:0;border-radius:50%;opacity:0;will-change:transform,opacity}
.op-shot .ow-drift{animation:none}
@media (prefers-reduced-motion:reduce){.ow-drift{animation:none}}

/* ---------------- ?screen=atlas dev harness ---------------- */
.at-dev .at-dev-k{position:absolute;left:56px;top:40px;font:400 12.5px/1 var(--sans);letter-spacing:.28em;text-transform:uppercase;color:var(--brass,#c99c6e);text-shadow:0 1px 10px rgba(9,2,4,.9)}
.at-dev .at-dev-t{position:absolute;left:56px;top:72px;margin:0;font:12px/1.55 ui-monospace,Menlo,Consolas,monospace;color:var(--cream,#c9b6a2);text-shadow:0 1px 6px rgba(9,2,4,.95);white-space:pre}
