/* The cave (index.html #cave), Plato's allegory (Republic VII 514a-517a): the clay-lit back wall with the two men's shadows,
   the low wall (τειχίον) in front of it, the rock arch around, a faint shaft of daylight
   from the mouth high up. The fire is behind the visitor: only its light moves (cave.js sets --fi/--fx/--fy/--fk/--fs).
   --pt / --pb: the parapet's top and foot, from the bottom of the screen (cave.js reads them to draw the stone). */
/* opacity only, never visibility: a hidden-but-opacity-0 layer still gets painted ahead of time (the SVG mask, the
   blend layers, the baked rock bitmap), so the move into the cave isn't also its first, multi-second paint */
/* cave.js writes these 10 ten times a second: typed (not plain custom properties) so the engine knows their values
   can only ever be a <number>, which keeps the per-tick style recalc to the handful of rules that use them instead of
   the untyped-custom-property fallback (an inherited property whose value could be anything, so any set invalidates
   style for the whole subtree under .cave, including the stones SVG that never reads one of these). */
@property --fi { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --fi2 { syntax: "<number>"; inherits: true; initial-value: .7; }
@property --fx { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --fy { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --fx2 { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --fk { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --fs { syntax: "<number>"; inherits: true; initial-value: 1; }
/* the second shadow's lean at rest (cave.js sways it around this): never 0, or the ghost hides exactly under the shadow */
@property --gk { syntax: "<number>"; inherits: true; initial-value: -3.5; }
@property --go { syntax: "<number>"; inherits: true; initial-value: .22; }

.cave { --ph: min(50svh, 30vw); --pt: 31svh; --pb: 17svh; --fi: 1; --fx: 0; --fy: 0; --fk: 0; --fs: 1; --fi2: .7; --fx2: 0; --gk: -3.5; --go: .22;
  background: #0b0605; opacity: 0; pointer-events: none; transition: opacity .01s .52s; }   /* on the way up it goes while the earth covers the screen, or it shows when the earth has passed */
.in-cave .cave { opacity: 1; pointer-events: auto; transition: opacity .9s 1.25s; }   /* waits out the dig (land.css .descent.down .strata, 1.25s), so the cave only lights once the earth has passed */

/* the back wall: a vase surface lit from below, darker where it curves away at the sides and the top.
   The rough-edged mask (land/cave-face.svg, a feTurbulence/feDisplacementMap/feGaussianBlur filter) is set by cave.js
   from a small baked bitmap, not this live vector file: a mask painted at the full screen size would make the browser
   rasterise that filter chain at every screen pixel even while opacity: 0 (see the comment above), so it is baked once
   at a low internal resolution and stretched here like any other image. No mask until then (invisible anyway). */
.cave .wall, .cave .fx { position: absolute; inset: 0;
  -webkit-mask-size: 100% 100%; -webkit-mask-position: center; -webkit-mask-repeat: no-repeat;
  mask-size: 100% 100%; mask-position: center; mask-repeat: no-repeat; }
.cave .wall { background:
    linear-gradient(90deg, rgba(22, 8, 3, .62), rgba(22, 8, 3, .18) 16%, rgba(22, 8, 3, 0) 30%, rgba(22, 8, 3, 0) 70%, rgba(22, 8, 3, .18) 84%, rgba(22, 8, 3, .62)),
    linear-gradient(rgba(22, 8, 3, .55), rgba(22, 8, 3, 0) 30%),
    repeating-linear-gradient(90deg, rgba(60, 22, 8, 0) 0 23px, rgba(60, 22, 8, .1) 23px 24px, rgba(60, 22, 8, 0) 24px 61px, rgba(60, 22, 8, .07) 61px 62px),
    radial-gradient(52% 60% at 50% 72%, #d88c55, #b4693a 55%, #6e2e14); }
/* the firelight on the wall: a warm pool from below that breathes and wanders a little. Plain alpha (no blend mode,
   like land.css .tint): the wall under it is already dark, so a screen blend and a painted-over glow read the same,
   and a phone composites a translated+faded layer for free instead of recomputing a blend against the backdrop
   every 55ms tick (the cave's ~1.5-3fps: GPUTask dominated the trace). */
.cave .fx { inset: -4%; background: radial-gradient(46% 52% at 50% 92%, rgba(255, 196, 120, .4), rgba(255, 170, 90, .12) 55%, rgba(255, 170, 90, 0) 75%);
  opacity: var(--fi); transform: translate(calc(var(--fx) * 1px), calc(var(--fy) * 1px)); will-change: transform, opacity; }
/* the fire's other tongue: a second, taller pool that wanders on its own across the wall */
.cave .fx::after { content: ""; position: absolute; inset: 0; opacity: var(--fi2); transform: translateX(calc(var(--fx2) * 1px));
  background: radial-gradient(20% 46% at 44% 96%, rgba(255, 206, 140, .26), rgba(255, 170, 90, 0) 70%),
    radial-gradient(16% 36% at 60% 98%, rgba(255, 190, 120, .2), rgba(255, 170, 90, 0) 70%); }

/* the shadows of the carried things (cave.js parade walks them): behind the men, standing on the parapet's top, lost
   toward the rock at both sides */
.cave .parade { position: absolute; left: 0; right: 0; bottom: var(--pt); height: calc(var(--ph) * .92); overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 5%, #000 18%, #000 82%, transparent 95%); mask-image: linear-gradient(90deg, transparent 5%, #000 18%, #000 82%, transparent 95%); }
.parade img { position: absolute; left: 0; bottom: 0; height: 48%; width: auto; aspect-ratio: 12 / 17; opacity: 0; transform-origin: 50% 100%; }
.parade img:nth-child(3n) { height: 54%; } .parade img:nth-child(3n + 1) { height: 44%; }
/* still (reduced motion / ?shot=1): two of them held on the wall, one each side */
.parade.still img:nth-child(2) { opacity: .4; left: 14%; } .parade.still img:nth-child(6) { opacity: .4; left: 78%; }
@media (max-width: 700px), (max-aspect-ratio: 4/5) { .cave .parade { height: calc(var(--ph) * 1.3); } .parade img:nth-child(n) { height: 94%; } }

/* the shadows: larger than life, soft at the edge, bent a little by the curve of the wall, moving with the flame */
.cave .men { position: absolute; z-index: 2; left: 50%; bottom: calc(var(--pt) + .4svh); transform: translateX(-50%); display: flex; align-items: flex-end; gap: calc(var(--ph) * .16); }
.man { position: relative; margin: 0; height: var(--ph); }
/* the canon pair (art.js, Art.PAIR): Manes 480 units to seated Philoxenos' 465 */
.manes { height: calc(var(--ph) * 1.03); }
.sh { height: 100%; opacity: 0; transition: opacity 1.2s; transform-origin: 50% 100%; }
.sh { will-change: transform; }
.phil .sh { transform: perspective(1400px) rotateY(10deg) skewX(calc(var(--fk) * 1deg)) scale(var(--fs)); }
.manes .sh { transform: perspective(1400px) rotateY(-10deg) skewX(calc(var(--fk) * 1deg)) scale(var(--fs)); }
.sh.on { opacity: .9; }
.sh { position: relative; }
/* the second shadow, from the fire's other tongue: fainter, leaning its own way. Two lights' shadows of one body meet
   where it touches the ground, so the ghost only leans from the feet, never slides (a slide read as a misprint) */
.sh .ghost { position: absolute; left: 0; top: 0; opacity: var(--go); transform-origin: 50% 100%; will-change: transform;
  transform: skewX(calc(var(--gk) * 1deg)) scaleY(1.03); }
/* the filter lives on the svg child, which is never itself transformed (.sh, the parent, carries the skewX/scale
   from the flame): its filtered bitmap is static content the browser can rasterise once and just move with .sh,
   instead of recomputing blur/drop-shadow bounds every tick because the filtered element's own shape changed */
.sh svg { display: block; height: 100%; width: auto; filter: blur(calc(var(--ph) * .0011)) drop-shadow(0 0 calc(var(--ph) * .012) rgba(26, 12, 6, .4)); }
.sh .glaze { fill: #140b07; }
.sh .c { fill: none; }
.sh .red { fill: #1d0e08; }   /* a shadow has no colour: the red is all but gone until the pointer turns the visitor round (hover below) */

/* the pointer on a shadow: the fire leaps behind it (cave.js) and for a moment the shadow is the man himself, his eye and the
   red coming up in the black, as if the visitor had turned round to look (Republic VII 515c). The ghost stays a shadow; fills only, one paint */
.man::before { content: ""; position: absolute; z-index: -1; inset: -16% -38%; pointer-events: none; opacity: 0; transition: opacity .8s ease;
  background: radial-gradient(closest-side, rgba(255, 176, 96, .5), rgba(255, 150, 70, .2) 56%, rgba(255, 150, 70, 0)); }
.sh > svg:not(.ghost) :is(.glaze, .c, .red) { transition: fill .7s ease; }
.sh .incise { stroke: transparent; transition: stroke .7s ease; }
@media (hover: hover) {
  .man:hover::before { opacity: 1; }
  .man:hover .sh.on { opacity: 1; }
  .man:hover .sh > svg:not(.ghost) .glaze { fill: #241007; }
  .man:hover .sh > svg:not(.ghost) .incise { stroke: #cf7f47; }
  .man:hover .sh > svg:not(.ghost) .red { fill: #5e2214; }   /* an ember in the dark, not paint: it is still a shadow (the owner, 10/11) */
  .man:hover b { color: #ffdcab; }
}

/* the names and one line each: written on the rock in the fire's light, no tablet. The wall's own tone is too near the
   letters' for AA when the flame dips, so a shadow hugs the letters and the wall dims a little around them.
   Hung from the same height over the shared feet (top, not bottom: a two-line and a one-line caption then start level) */
.man figcaption { position: absolute; top: calc(100% - var(--ph) * .5); width: min(340px, 20vw); isolation: isolate; color: #fff1dc;
  text-shadow: 0 1px 2px rgba(26, 10, 4, .9), 0 0 14px rgba(34, 13, 5, .85), 0 0 30px rgba(34, 13, 5, .5); }
.man figcaption::before { content: ""; position: absolute; z-index: -1; inset: -34px -56px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(34, 13, 5, .3), rgba(34, 13, 5, .14) 55%, rgba(34, 13, 5, 0)); }
.phil figcaption { right: calc(100% + 2vw); text-align: right; }
.manes figcaption { left: calc(100% + 2vw); }
.man b { display: block; font: 400 var(--fs-md)/var(--lh-ui) var(--greek); letter-spacing: var(--ls-inscr); color: #ffd39c; }
.man span { display: block; margin-top: 10px; font: 400 var(--fs-md)/var(--lh-read) var(--serif); text-wrap: pretty; }
.cave .who { display: none; }   /* the phone's one paragraph (below) */

/* the rock, the parapet, and the floor (one SVG, drawn to the window by cave.js) */
.cave .rock { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* the fire's light on everything in front: a warm wash from below and behind the visitor */
.cave .glare { position: absolute; left: -10%; right: -10%; bottom: -20svh; height: 75svh; pointer-events: none;
  background: radial-gradient(50% 60% at 50% 100%, rgba(255, 150, 70, .34), rgba(255, 130, 60, 0) 70%);
  opacity: var(--fi); transform: translate(calc(var(--fx) * 1.6px), calc(var(--fy) * -1px)); will-change: transform, opacity; }
/* no live filter: a radial-gradient is already soft-edged, so a few more stops read the same as the old
   blur(11px) without the GPU's blur pass on this large (-10%..110% wide, 60svh tall), continuously-animating layer */
.cave .smoke { position: absolute; left: -10%; right: -10%; bottom: -12svh; height: 60svh; pointer-events: none;
  background: radial-gradient(40% 36% at 32% 70%, rgba(150, 118, 96, .09) 0%, rgba(150, 118, 96, .06) 38%, rgba(150, 118, 96, .025) 58%, rgba(150, 118, 96, 0) 78%),
    radial-gradient(34% 30% at 70% 76%, rgba(150, 118, 96, .07) 0%, rgba(150, 118, 96, .045) 38%, rgba(150, 118, 96, .018) 58%, rgba(150, 118, 96, 0) 78%);
  animation: smoke 24s ease-in-out infinite alternate; }
@keyframes smoke { from { transform: translate(-2vw, 0); opacity: .6; } to { transform: translate(2vw, -9svh); opacity: 1; } }
/* dust turning in the daylight shaft (cave.js places the specks along it) */
.motes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.motes b { position: absolute; width: var(--z); height: var(--z); border-radius: 50%; background: #fbeedd; box-shadow: 0 0 4px rgba(251, 238, 221, .7);
  opacity: 0; animation: mote var(--d) ease-in-out var(--dl) infinite; }
/* still (reduced motion / ?shot=1): held at a representative brightness, no drift */
.motes b.still { opacity: var(--o); animation: none; }
@keyframes mote { 0% { transform: translate(0, 0); opacity: 0; } 25% { opacity: var(--o); } 50% { opacity: calc(var(--o) * .35); }
  75% { opacity: var(--o); } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
.embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.embers b { position: absolute; bottom: -8px; width: var(--z); height: var(--z); border-radius: 50%; background: #ffc27a;
  box-shadow: 0 0 6px 1px rgba(255, 138, 58, .8); opacity: 0; animation: ember var(--d) linear var(--dl) infinite; }
.embers b.still { opacity: var(--o); animation: none; }
@keyframes ember { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: var(--o); }
  70% { opacity: calc(var(--o) * .6); } 100% { transform: translate(var(--dx), -58svh); opacity: 0; } }


/* drips from the tips of the vault: a bead swells, lets go, falls with the fire in it, and rings where it lands */
/* the live floor over the baked rock (cave.js floorx): its firelight breathes with the flame (--fi) */
.floorx { position: absolute; inset: 0; pointer-events: none; } .floorx svg { display: block; }
.floorx .fl { opacity: calc(.55 + var(--fi) * .45); mix-blend-mode: screen; }
/* the pool: the wall's warm light lying on dark water, a wet rim, the men upside down in it (cave.js clones .men into
   .refl), the surface trembling and a few slow streaks of light crossing it */
.floorx .poolw { position: absolute; left: 33%; right: 21%; bottom: 1.5svh; }
.floorx .pool { position: absolute; inset: 0; overflow: hidden; border-radius: 50%;
  -webkit-mask-image: radial-gradient(closest-side, #000 70%, rgba(0, 0, 0, .6) 86%, transparent 100%); mask-image: radial-gradient(closest-side, #000 70%, rgba(0, 0, 0, .6) 86%, transparent 100%);
  background: radial-gradient(60% 55% at 50% 30%, rgba(196, 118, 62, .55), rgba(120, 62, 30, .4) 55%, rgba(16, 6, 3, .92) 100%); }
.floorx .refl { position: absolute; pointer-events: none; opacity: .72; filter: blur(.8px); }
.floorx .refl .men { animation: pool-tremble 7s ease-in-out infinite alternate; }
.floorx .refl .sh { opacity: .9; }
@keyframes pool-tremble { from { transform: translateX(-50%) skewX(-.6deg) scaleX(1); } to { transform: translateX(-50.4%) skewX(.6deg) scaleX(1.012); } }
/* a drop from the vault landing: a ring spreading on the water and fading, flattened by the angle we look at it from */
.floorx .rip { position: absolute; width: 90px; height: 18px; margin: -9px 0 0 -45px; border-radius: 50%; border: 1px solid rgba(255, 214, 168, .4);
  transform: scale(.05); opacity: 0; animation: pool-rip 6.8s ease-out infinite; }
@keyframes pool-rip { 0% { transform: scale(.05); opacity: .9; } 70% { opacity: .25; } 100% { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .floorx .refl .men, .floorx .rip { animation: none; } .floorx .rip { display: none; } }
.drips { position: absolute; inset: 0; pointer-events: none; }
.drips b { position: absolute; width: 3px; height: 4px; margin-left: -1.5px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 40% 65%, #ffe2b4, #d98a4a 55%, rgba(120, 50, 20, .6)); opacity: 0; transform-origin: 50% 0;
  animation: drip var(--d) cubic-bezier(.5, 0, 1, .6) var(--dl) infinite; }
.drips b::after { content: ""; position: absolute; left: 50%; top: var(--fall); width: 18px; height: 5px; margin: -2.5px 0 0 -9px; border-radius: 50%;
  border: 1px solid rgba(255, 196, 130, .7); opacity: 0; animation: ring var(--d) ease-out var(--dl) infinite; }
@keyframes drip { 0% { transform: scale(.2); opacity: 0; } 40% { opacity: .85; } 58% { transform: scale(1, 1.25); opacity: .95; }
  64% { transform: translateY(var(--fall)) scale(.7, 2.6); opacity: .9; } 64.5%, 100% { transform: translateY(var(--fall)) scale(0); opacity: 0; } }
@keyframes ring { 0%, 64% { transform: scale(.2); opacity: 0; } 65% { opacity: .8; } 80%, 100% { transform: scale(1.8); opacity: 0; } }

/* the warmth behind the way in: a pool of the fire's light that breathes with the flame (opacity only) */
.cave .invite { position: absolute; left: 50%; bottom: calc((var(--pt) + var(--pb)) / 2 - 70px); width: min(520px, 90vw); height: 140px; transform: translateX(-50%);
  pointer-events: none; opacity: calc(.45 + (var(--fi) - .84) * 1.6);
  background: radial-gradient(closest-side, rgba(255, 160, 70, .4), rgba(255, 130, 50, .12) 55%, rgba(255, 130, 50, 0)); }

/* the way in: black glaze, the cue's family (the visit's marks); the warm ring, brightening under the hand, is the lit cue.
   Set on the parapet's face under the men, the scene's one action where the eye already is (not afloat over the floor) */
.enter.btn { white-space: nowrap; position: absolute; z-index: 3; left: 50%; bottom: calc((var(--pt) + var(--pb)) / 2); transform: translate(-50%, 50%); min-height: calc(var(--ctl-h) + 10px); padding: 0 clamp(24px, 14px + min(1.6vw, 2.6vh), 46px);
  border-radius: var(--r-pill); border: 0; color: #f3e4cd; font: 400 var(--fs-lg) var(--greek); text-decoration: none;
  display: inline-flex; align-items: center;
  background: radial-gradient(120% 140% at 35% 25%, rgba(255, 224, 194, .12), transparent 60%), #150c08;
  box-shadow: inset 0 0 0 2px #150c08, inset 0 0 0 3px rgba(217, 146, 95, .62), 0 6px 16px rgba(0, 0, 0, .4);
  transition: box-shadow .3s, color .3s; }
.enter.btn:hover, .enter.btn:focus-visible { color: #fff4e2;
  box-shadow: inset 0 0 0 2px #150c08, inset 0 0 0 3px rgba(231, 164, 108, .95), 0 6px 20px rgba(0, 0, 0, .45); }
.enter.btn:focus-visible { outline: 2px solid #f3e4cd; outline-offset: 3px; }

/* centred under the centred scene (right-aligned, the whole page leant to one side) */
.cave .foot-min { position: absolute; left: 0; right: 0; bottom: 0; justify-content: center; align-items: center; padding: 6px 22px max(8px, env(safe-area-inset-bottom));
  font-size: var(--fs-sm); background: none; }
.cave .foot-min nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; }

/* phone: the two men in one paragraph above (the owner, 05/11: the two names with a line each under the other did
   not look good), the two shadows side by side over the parapet */
@media (max-width: 700px), (max-aspect-ratio: 4/5) {
  .cave { --ph: 33svh; --pt: 24svh; --pb: 14svh; }   /* the men large, the parapet lower and shorter (the owner, 05/11) */
  .cave .men { left: 0; right: 0; top: 48px; transform: none; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto;
    justify-content: center; align-items: end; align-content: end; column-gap: 3vw; row-gap: 6px; }   /* the names just over the men's heads, not at the arch's crown (the owner, 05/11) */
  .man { display: contents; }
  .sh { grid-row: 2; height: var(--ph); margin-top: 3svh; }
  .phil .sh { justify-self: end; }
  .manes .sh { justify-self: start; height: calc(var(--ph) * 1.03); }
  .cave .wall, .cave .fx { -webkit-mask-size: 118% 104%; mask-size: 118% 104%; }
  .cave .wall { background-size: 100% 100%; background-image:
    linear-gradient(90deg, rgba(22, 8, 3, .45), rgba(22, 8, 3, 0) 9%, rgba(22, 8, 3, 0) 91%, rgba(22, 8, 3, .45)),
    linear-gradient(rgba(22, 8, 3, .62), rgba(22, 8, 3, .3) 16%, rgba(22, 8, 3, 0) 38%),   /* the vault in shadow: the fire is low, behind you, so the light pools where the men stand */
    repeating-linear-gradient(90deg, rgba(60, 22, 8, 0) 0 23px, rgba(60, 22, 8, .1) 23px 24px, rgba(60, 22, 8, 0) 24px 61px, rgba(60, 22, 8, .07) 61px 62px),
    radial-gradient(70% 60% at 50% 66%, #d88c55, #b4693a 60%, #7a3418); }
  .man figcaption { display: none; }
  .cave .who { display: block; position: relative; isolation: isolate; grid-row: 1; grid-column: 1 / -1; margin: 0 28px 2svh; padding: 4px 0;
    text-align: center; text-wrap: pretty; color: #fff1dc; font: 400 var(--fs-md)/var(--lh-read) var(--serif);
    text-shadow: 0 1px 2px rgba(26, 10, 4, .9), 0 0 14px rgba(34, 13, 5, .85), 0 0 30px rgba(34, 13, 5, .5); }
  .cave .who::before { content: ""; position: absolute; z-index: -1; inset: -14px -20px; pointer-events: none;
    background: radial-gradient(closest-side, rgba(34, 13, 5, .34), rgba(34, 13, 5, .2) 50%, rgba(34, 13, 5, 0)); }
  .cave .who b { font: 400 var(--fs-sm)/var(--lh-ui) var(--greek); letter-spacing: var(--ls-inscr); color: #f3b878; }   /* the names in clay, as an inscription */
  .cave .foot-min { justify-content: center; padding-bottom: max(6px, env(safe-area-inset-bottom)); font-size: var(--fs-xs); }
  .cave .foot-min nav { justify-content: center; gap: 0 8px; }
  .cave .foot-min nav a, .cave .foot-min nav .linkish { padding: 14px 5px; }   /* a finger's targets, the look unchanged */
  /* the button sits on the stone's lower course, the links at the bottom */
  .enter.btn { bottom: calc(var(--pb) + 2px); transform: translateX(-50%); min-height: var(--ctl-h); font-size: var(--fs-sm);
    padding: 0 clamp(20px, 12px + min(1.4vw, 2.2vh), 40px); }   /* the phone's button as it was (the owner's 05/11 layout): only the desktop one grew */
  .cave .invite { bottom: calc(var(--pb) - 42px); }
}

/* the way out: the daylight at the mouth (cave.js draws it there) grows until it is all there is, and the shadows go
   with it; the gate opens out of the same colour (#daylight in deploy/world/gate.css). Keep the two colours equal. */
.daylight { position: fixed; inset: 0; z-index: 200; overflow: hidden; pointer-events: none; visibility: hidden; --mx: 64%; }
.daylight::before { content: ""; position: absolute; left: var(--mx); top: 0; width: 100vmax; height: 100vmax; margin: -50vmax 0 0 -50vmax; border-radius: 50%;
  background: radial-gradient(closest-side, #fbeed3 50%, rgba(251, 238, 211, .55) 72%, rgba(251, 238, 211, 0)); transform: scale(.03); opacity: .35;
  will-change: transform, opacity; }   /* rastered once and only scaled: re-rastering a 100vmax gradient at every size stuttered (07/11) */
.leaving .daylight { visibility: visible; }
.leaving .daylight::before { transform: scale(6); opacity: 1; transition: transform .75s cubic-bezier(.55, 0, .75, 1), opacity .3s ease; }
.cave .enter, .cave figcaption, .cave .foot-min, .cave .sh { transition: opacity .35s ease; }
.leaving .cave .enter, .leaving .cave figcaption, .leaving .cave .foot-min { opacity: 0; }
.leaving .cave .sh.on { opacity: .2; transition: opacity .7s ease; }
@media (max-width: 700px), (max-aspect-ratio: 4/5) { .daylight { --mx: 46%; } }

/* the arrival: the fire catches as you come down, the men's shadows leap up the wall, huge and pale (a figure close
   to the flame throws the biggest shadow), then settle to their size as the light steadies. On the svg children,
   never .sh (cave.js moves .sh). The shadow-play turn of Manes' shadow is gone (the owner, 05/11: he must not turn).
   Not on a phone (the owner, 06/11): there the shadows stand at their size from the first frame; the swaying second
   shadow (.ghost) stays, the owner wants it */
@media (prefers-reduced-motion: no-preference) and (min-width: 701px) and (min-aspect-ratio: 4/5) {
  :root.in-cave:not(.h3-still) .sh > svg { transform-origin: 50% 100%; animation: leap 1.9s cubic-bezier(.2, .7, .2, 1) .25s backwards; }
  :root.in-cave:not(.h3-still) .manes .sh > svg { animation-delay: .4s; }
}
@keyframes leap { from { opacity: .15; } 55% { opacity: 1; } }   /* the men keep their size from the first frame (the owner, 07/11) */

/* off-screen (the dusk is showing) the cave keeps still */
:root:not(.in-cave) .cave *, :root:not(.in-cave) .cave *::before, :root:not(.in-cave) .cave *::after { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .cave .smoke { animation: none; }
  .drips { display: none; }
  .sh .ghost { opacity: .18; transform: skewX(-3.5deg) scaleY(1.03); }
  .daylight::before { transform: scale(6); opacity: 0; }
  .leaving .daylight::before { transition: opacity .3s ease; }
  .land .cave, .in-cave .cave, .cave .sh { transition: none; }
}
