/* work-lab/rv.css — pass 2 "the RV workshop": day / night light, the torch, the folder wall, the switch, the RV's objects. */

/* ------------------------------------------------------------ day and night */
/* Registered so they can interpolate where view transitions are missing (see the switch below). */
@property --veil{syntax:'<color>';inherits:true;initial-value:#fff}
@property --lit-hole{syntax:'<color>';inherits:true;initial-value:#fff}
@property --lit-lamp{syntax:'<color>';inherits:true;initial-value:#fff}
@property --lit-obj{syntax:'<color>';inherits:true;initial-value:#fff}
@property --lit-poster{syntax:'<color>';inherits:true;initial-value:#fff}
@property --lit-win{syntax:'<color>';inherits:true;initial-value:#fff}
@property --gl-hole{syntax:'<color>';inherits:true;initial-value:transparent}
@property --gl-lamp{syntax:'<color>';inherits:true;initial-value:transparent}
@property --gl-win{syntax:'<color>';inherits:true;initial-value:transparent}
@property --sky-a{syntax:'<color>';inherits:true;initial-value:#8fb6dc}
@property --sky-b{syntax:'<color>';inherits:true;initial-value:#dbe9f2}
@property --sea-a{syntax:'<color>';inherits:true;initial-value:#4f8db0}
@property --sea-b{syntax:'<color>';inherits:true;initial-value:#2f6c8e}
@property --cliff-a{syntax:'<color>';inherits:true;initial-value:#b7a58a}
@property --cliff-b{syntax:'<color>';inherits:true;initial-value:#8f7d64}
@property --sun-c{syntax:'<color>';inherits:true;initial-value:#fffbe8}
@property --sun-x{syntax:'<length>';inherits:true;initial-value:330px}
@property --sun-y{syntax:'<length>';inherits:true;initial-value:96px}
@property --sun-o{syntax:'<number>';inherits:true;initial-value:1}
@property --moon-o{syntax:'<number>';inherits:true;initial-value:0}
@property --shx{syntax:'<length>';inherits:true;initial-value:0px}
@property --shy{syntax:'<length>';inherits:true;initial-value:12px}
@property --shb{syntax:'<length>';inherits:true;initial-value:16px}
@property --shc{syntax:'<color>';inherits:true;initial-value:rgba(40,32,20,.3)}
@property --note{syntax:'<color>';inherits:true;initial-value:#c96f86}
@property --ink-top{syntax:'<color>';inherits:true;initial-value:#151614}
@property --fore-b{syntax:'<number>';inherits:true;initial-value:1}

:root,[data-scene=day]{--veil:#fff;--lit-hole:#fff;--lit-lamp:#fff;--lit-obj:#fff;--lit-poster:#fff;--lit-win:#fff;
  --gl-hole:rgba(0,0,0,0);--gl-lamp:rgba(0,0,0,0);--gl-win:rgba(0,0,0,0);
  --sky-a:#8fb6dc;--sky-b:#dbe9f2;--sea-a:#5f97b6;--sea-b:#2f6c8e;--cliff-a:#b7a58a;--cliff-b:#8f7d64;--sun-c:#fffbe8;--sun-x:330px;--sun-y:96px;--sun-o:1;--moon-o:0;
  --shx:0px;--shy:1.3vh;--shb:1.8vh;--shc:rgba(40,32,20,.3);--note:#c4627c;--ink-top:#151614;--fore-b:1}
/* night: a dark wall; the hole, the bench lamp and a soft practical on every object carry the scene */
[data-scene=night]{--veil:#4d5269;--lit-hole:#fff0d8;--lit-lamp:#ffeccf;--lit-obj:#d9d3cb;--lit-poster:#e6e0d7;--lit-win:#8e9cc4;
  --gl-hole:rgba(255,204,140,.3);--gl-lamp:rgba(255,226,170,.3);--gl-win:rgba(120,150,220,.2);
  --sky-a:#121a33;--sky-b:#2e3c64;--sea-a:#1e2b4b;--sea-b:#0e1629;--cliff-a:#1b1e2b;--cliff-b:#10121b;--sun-c:#c9d6ff;--sun-x:330px;--sun-y:250px;--sun-o:0;--moon-o:1;
  --shx:0px;--shy:.6vh;--shb:2.2vh;--shc:rgba(8,8,18,.45);--note:#f2c9d4;--ink-top:#ece6da;--fore-b:.45}
/* The switch is a crossfade (light.js: a view transition): the old light is a picture fading out over the new one,
   compositor opacity only; nothing below re-rasterises per frame. Browsers without view transitions interpolate. */
@supports not (view-transition-name:none){
.lux-ready{transition:--veil 1.2s ease,--lit-hole 1.2s ease,--lit-lamp 1.2s ease,--lit-obj 1.2s ease,--lit-poster 1.2s ease,--lit-win 1.2s ease,--gl-hole 1.2s ease,--gl-lamp 1.2s ease,--gl-win 1.2s ease,
  --sky-a 1.2s ease,--sky-b 1.2s ease,--sea-a 1.2s ease,--sea-b 1.2s ease,--cliff-a 1.2s ease,--cliff-b 1.2s ease,--sun-c 1.2s ease,--sun-x 1.2s ease,--sun-y 1.2s ease,
  --sun-o 1.2s ease,--moon-o 1.2s ease,--shx 1.2s ease,--shy 1.2s ease,--shb 1.2s ease,--shc 1.2s ease,--note 1.2s ease,--ink-top 1.2s ease,--fore-b 1.2s ease}
}
html.lux-switching::view-transition-group(root),html.lux-switching::view-transition-old(root),html.lux-switching::view-transition-new(root){animation-duration:1.2s;animation-timing-function:ease}
/* the new scene arrives finished: no second, slower fade of the header or the glass under the crossfade */
.lux-switching .top,.lux-switching .sheen,.lux-switching .torch{transition:none}
/* by day the light layers are white-on-multiply and clear-on-screen: identical to nothing, so they are not composited */
@supports (view-transition-name:none){[data-scene=day] .lux-veil,[data-scene=day] .lux-glow{display:none}}
/* ambient (multiply) with pools where light reaches; the practicals' glow on top (screen) */
.lux-veil,.lux-glow{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.lux-veil{z-index:8;background:var(--veil);mix-blend-mode:multiply}
.lux-glow{z-index:9;mix-blend-mode:screen}
.lux-set{position:absolute;inset:0}
.pool{position:absolute;border-radius:50%;background:radial-gradient(closest-side,var(--pc) 28%,color-mix(in srgb,var(--pc) 55%,transparent) 62%,color-mix(in srgb,var(--pc) 18%,transparent) 84%,transparent)}
.p-hole{--pc:var(--lit-hole)}.p-lamp{--pc:var(--lit-lamp)}.p-obj{--pc:var(--lit-obj)}.p-poster{--pc:var(--lit-poster)}.p-win{--pc:var(--lit-win)}
.gl{position:absolute}
.gl-hole{border-radius:50%;background:radial-gradient(closest-side,var(--gl-hole),rgba(0,0,0,0))}
.gl-cone{background:linear-gradient(180deg,var(--gl-lamp),rgba(0,0,0,0) 82%);filter:blur(2px)}
.gl-win{border-radius:50%;background:radial-gradient(closest-side,var(--gl-win),rgba(0,0,0,0))}
/* the torch at the pointer: a warm pool in the ambient layer + a glow on top; it flickers like a small flame */
.torch{position:absolute;left:0;top:0;width:440px;height:440px;opacity:0;transition:opacity .45s ease;will-change:transform}
.torch b{position:absolute;inset:0;border-radius:50%}
.t-pool b{background:radial-gradient(closest-side,#fff1da 0,#ffe8c6 30%,color-mix(in srgb,#ffe2bb 50%,transparent) 58%,color-mix(in srgb,#ffe2bb 16%,transparent) 82%,transparent)}
.t-glow b{background:radial-gradient(closest-side,rgba(255,196,120,.26) 0,rgba(255,170,90,.1) 45%,rgba(0,0,0,0) 80%)}
.torch-on .torch{opacity:1}
.torch-on .torch b{will-change:transform,opacity} /* the flame moves them every frame while lit: no repaint of the glow */
/* its flicker is written by light.js (layered noise + an occasional gutter), only while it is lit */
[data-scene=day] .torch{display:none}
/* the things in front dim at night. The dimming is part of each thing's own (static, rasterised) filter, after its
   blur and shadow = the old brightness() on the whole moving .fore layer, which was one more full-screen pass per frame */
.f{filter:blur(1.2px) drop-shadow(0 1.2vh 1vh rgba(40,32,20,.28)) brightness(var(--fore-b))}
/* posters at night are lit by the spill: their pool is a little brighter (light.js 'poster'), not a filter on the
   sheet, which held the sheet's moving forms (lens, moon, marker) in an extra render pass at every frame of the walk */
/* chalk on a dark wall: a little brighter */
[data-scene=night] .chalk{filter:brightness(1.35) saturate(1.1)}
/* folder glass catches what light there is */
[data-scene=night] .sheen{opacity:.95}
[data-scene=night] .front:before{opacity:1}

/* ------------------------------------------------------- handwritten arrows */
.arw{display:inline-block;width:1.05em;height:1.05em;vertical-align:-.2em;overflow:visible;flex:none}
.arw-ur{width:.95em;height:.95em;vertical-align:-.12em}

/* ------------------------------------------------------- the switch plate */
.switch-spot{position:absolute;left:77.5vh;top:31vh;z-index:4}
.switch{position:relative;display:block;width:4.4vh;height:7.2vh;min-width:30px;min-height:48px;cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none}
.sw-plate{position:absolute;inset:0;border-radius:5px;background:linear-gradient(160deg,#fbf8f1,#e9e3d6 70%,#ddd5c5);
  box-shadow:inset 0 1px 0 #fff,inset 0 -1px 0 rgba(0,0,0,.12),0 0 0 .5px rgba(90,80,60,.3),var(--shx) calc(var(--shy) * .5) calc(var(--shb) * .5) var(--shc)}
.sw-screw{position:absolute;left:50%;width:5px;height:5px;margin-left:-2.5px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff,#b9b4a8 60%,#8c8678)}
.sw-screw:first-child{top:7%}.sw-screw:last-child{bottom:7%}
.sw-well{position:absolute;left:28%;right:28%;top:28%;bottom:28%;border-radius:3px;background:#cfc7b7;box-shadow:inset 0 1px 2px rgba(60,50,30,.35)}
.sw-rocker{position:absolute;inset:1px;border-radius:2px;background:linear-gradient(180deg,#f6f2ea 0,#fffdf8 46%,#d9d2c3 50%,#ece6da 100%);box-shadow:0 1px 1px rgba(60,50,30,.25);transition:transform .25s var(--ease)}
[data-scene=night] .sw-rocker{background:linear-gradient(180deg,#e2dbcd 0,#ece6da 50%,#fbf8f1 54%,#fffdf8 100%)}
.switch.flick .sw-rocker{animation:sw-flick .3s var(--ease)}.switch.flick2 .sw-rocker{animation:sw-flick2 .3s var(--ease)}
@keyframes sw-flick{40%{transform:scaleY(.86)}}@keyframes sw-flick2{40%{transform:scaleY(.86)}}
.switch:focus-visible{outline-offset:6px;border-radius:6px}
.sw-tick{position:absolute;left:118%;top:4%;width:2.8vh;height:2.8vh;min-width:20px;min-height:20px;pointer-events:none}
.sw-tick .chalk{inset:0;width:100%;height:100%}

/* ----------------------------------------------------- 3 the folder wall */
/* four to a row, hung from nails by binder clips; rows are added by content, the station stays about one screen wide */
.bay-folders{display:flex;align-items:flex-start;padding:0 9vh 0 13vh;z-index:3}
.bay-folders .folders{--fw:min(26vh,calc(64vh / var(--rows,2) - 2vh));display:grid;grid-template-columns:repeat(4,var(--fw));gap:3.4vh 5vh;max-width:none;margin:0;padding-top:max(10vh,calc(44vh - var(--rows,2) * (var(--fw) * 1.12 + 2vh)))}
.bay-folders .folder{gap:1.2vh}
.hang{--cw:3.2vh;position:relative;display:block;transform-origin:12% calc(var(--cw) * -.65);transform:translate(var(--lx,0px),var(--ly,0px)) rotate(calc(var(--tilt,0deg) + var(--lr,0deg)));transition:transform .7s cubic-bezier(.3,1.4,.5,1)}
.dragging .hang{transition:transform .12s linear}
.dragging .fold,.lifted .fold{transform:none}
.clip{position:absolute;left:calc(12% - var(--cw) / 2);top:calc(var(--cw) * -.775);width:var(--cw);z-index:3;overflow:visible;filter:drop-shadow(var(--shx) calc(var(--shy) * .3) calc(var(--shb) * .25) var(--shc))}
/* the prints sit right of the clip, so the clip never lands on them (the light-table ghost uses the same places) */
.bay-folders .peek,.lt-fly .peek{width:40%}
.bay-folders .peek:nth-child(1),.lt-fly .peek:nth-child(1){left:25%;--rot:-6deg}
.bay-folders .peek:nth-child(2),.lt-fly .peek:nth-child(2){left:40%;top:5%;--rot:1deg}
.bay-folders .peek:nth-child(3),.lt-fly .peek:nth-child(3){left:55%;--rot:7deg}
.bay-folders .peek:only-child,.lt-fly .peek:only-child{left:38%;--rot:-3deg}
.bay-folders .peek:first-child:nth-last-child(2),.lt-fly .peek:first-child:nth-last-child(2){left:27%}
.bay-folders .peek:nth-child(2):last-child,.lt-fly .peek:nth-child(2):last-child{left:51%;--rot:6deg}
.bay-folders .f-back{filter:drop-shadow(0 2px 1px #0000001a) drop-shadow(var(--shx) var(--shy) var(--shb) var(--shc))}
.bay-folders .f-label{font-size:clamp(14px,1.9vh,17px);padding:0 .1em;flex-wrap:wrap;column-gap:10px}
.bay-folders .f-label b{overflow-wrap:normal}
.bay-folders .f-kind{font-size:clamp(10.5px,1.25vh,12px)}
.bay-folders .f-desc{margin-top:-.6vh;padding:0 .1em;font-size:clamp(12px,1.45vh,13px);-webkit-line-clamp:1}
.way-archive{left:2vh;top:5vh;width:20vh;height:12vh}

/* --------------------------------------------------- the task lamp on the bench */
.lamp-spot{position:absolute;right:2.5%;top:0;width:300px;transform:translateY(-75%);z-index:5;pointer-events:none}
.lamp-spot .tl{position:relative;display:block;width:100%}
.tl-art{display:block;width:100%;height:auto;overflow:visible}
.tl-head{position:absolute;left:22%;top:46%;width:2px;height:2px}
.tl .tl-body{filter:drop-shadow(var(--shx) calc(var(--shy) * .6) calc(var(--shb) * .5) var(--shc))}

/* --------------------------------------------------------- the RV's things */
.rv-bay{position:relative;font-size:1vh;z-index:3}
.bay-kristy{width:78em}.bay-studio{width:66em}.bay-coast{width:132em}
.coast-wall,.coast-low{position:absolute;inset:0}
.rv-obj{position:absolute;display:block;padding:0;pointer-events:none;cursor:default;text-align:left;-webkit-tap-highlight-color:transparent}
.rv-obj svg{display:block;width:100%;height:auto;overflow:visible;pointer-events:none}
.rv-obj svg *{pointer-events:visiblePainted}
.rv-obj:focus-visible{outline-offset:8px;border-radius:10px}
.kb{left:7em;bottom:3em;width:64em}.kb-art{filter:drop-shadow(var(--shx) var(--shy) var(--shb) var(--shc))}
.kb-board{position:absolute;left:6%;top:4%;width:88%;height:78%;pointer-events:none}
.st{left:5em;bottom:5em;width:56em}.st-art{filter:drop-shadow(var(--shx) var(--shy) var(--shb) var(--shc))}
.st-box{position:absolute;left:6%;top:21%;width:52%;height:42%;pointer-events:none}
.rv-window{left:8em;top:15em;width:50em}
.w-sun{transform:translate(var(--sun-x),var(--sun-y));opacity:var(--sun-o)}
.w-moon{transform:translate(118px,104px);opacity:var(--moon-o)}
.w-stars{opacity:calc(var(--moon-o) * .9)}
.w-path{opacity:calc(.35 + var(--sun-o) * .25)}
.sb{left:64em;bottom:17.5em;width:14.5em;transform:rotate(5deg);transform-origin:50% 100%}
.sb-art{filter:drop-shadow(var(--shx) var(--shy) var(--shb) var(--shc))}
.sp{left:84em;bottom:16em;width:24em}.sp-art{filter:drop-shadow(var(--shx) var(--shy) var(--shb) var(--shc))}
.cl{position:absolute;left:104em;bottom:13.4em;width:15em;pointer-events:none}.cl svg{display:block;width:100%;height:auto}
.dh{left:117em;bottom:13.5em;width:13em}.dh-art{filter:drop-shadow(var(--shx) var(--shy) var(--shb) var(--shc))}
.coast-floor{position:absolute;left:80em;bottom:12em;width:52em;height:30em;pointer-events:none}
/* without the draft window (see RV_DRAFT in lab.js) the end of the wall is just the board, the panel and the dish */
.bay-coast.no-window{width:86em}
.no-window .sb{left:10em}.no-window .sp{left:30em}.no-window .cl{left:50em}.no-window .dh{left:62em}.no-window .coast-floor{left:26em}
/* default page: the walk ends at the bench, with a little wall left after it */
.walk-ends-at-bench .bay-bench{padding-right:22vh}
.flat.walk-ends-at-bench .bay-bench{padding-right:10px;padding-bottom:84px}
/* the hidden notes: a few words in the pen, only when you look */
.rv-note{position:absolute;left:var(--nx,50%);bottom:calc(100% + var(--ny,1.4vh));transform:translate(-50%,6px) rotate(-4deg);white-space:nowrap;
  font:400 clamp(15px,2.1vh,19px)/1 var(--pen);color:var(--note);opacity:0;pointer-events:none;transition:opacity .35s var(--ease),transform .5s var(--ease)}
.rv-obj:focus-visible .rv-note,.rv-obj.show .rv-note{opacity:1;transform:translate(-50%,0) rotate(-4deg)}
@media (hover:hover){.rv-obj:hover .rv-note{opacity:1;transform:translate(-50%,0) rotate(-4deg)}}
.tl .rv-note{--nx:10%;--ny:-30%;left:-6%;transform:translate(-100%,6px) rotate(-5deg)}
.tl:focus-visible .rv-note,.tl.show .rv-note{transform:translate(-100%,0) rotate(-5deg)}
@media (hover:hover){.tl:hover .rv-note{transform:translate(-100%,0) rotate(-5deg)}}
.kb .rv-note{--nx:58%;--ny:-3vh}.st .rv-note{--nx:32%;--ny:-31vh}.sb .rv-note{--ny:.6vh}.sp .rv-note{--ny:1vh}.dh .rv-note{--nx:40%;--ny:1vh}

/* the corner way back: on arrival it fades in quietly, on its own */
.wall-hole.soft{transition:opacity .7s var(--ease),transform .9s var(--ease)}
.wall-hole.soft:not(.in){transform:scale(.88)}

/* --------------------------------------------- phones and reduced motion (.flat) */
.flat .rv-bay{width:auto;font-size:1px;display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-end;gap:28px 12px;padding:56px var(--g) 44px;
  background:linear-gradient(180deg,rgba(0,0,0,0) calc(100% - 52px),#cbc1ac calc(100% - 52px),#d6cdb9 calc(100% - 50px),#c4bba8 100%)}
.flat .coast-wall,.flat .coast-low{display:contents}
.flat .rv-obj,.flat .cl{position:relative;left:auto;top:auto;bottom:auto;transform:none}
.flat .kb{width:min(100%,460px)}
.flat .st{width:min(92%,400px)}
.flat .rv-window{flex:0 0 100%;max-width:440px;margin-bottom:24px}
.flat .sb{width:50px;transform:rotate(4deg);margin-right:6px}
.flat .sp{width:min(27vw,120px)}.flat .cl{width:min(13vw,60px)}.flat .dh{width:min(19vw,84px)}
.flat .sw-tick{left:auto;right:118%}
.flat .rv-note{font-size:16px;bottom:calc(100% + 8px)}
.flat .st .rv-note{--ny:-28%}
.flat .tl .rv-note{left:0;bottom:auto;top:30%}
.flat .switch-spot{left:auto;right:calc(var(--g) + 6px);top:auto;bottom:-8px}
.flat .bay-hole .backhole-wrap{position:relative}
.flat .lamp-spot{width:min(42vw,200px);right:4%}
.flat .bay-bench{padding-top:min(36vw,150px)}
.flat .bay-folders{display:block;padding:56px var(--g) 64px}
.flat .bay-folders .folders{--fw:auto;grid-template-columns:repeat(2,minmax(0,1fr));gap:44px 18px;padding-top:24px;max-width:760px;margin:0 auto}
.flat .bay-folders .folder{cursor:pointer}
.flat .hang{--cw:24px}
.flat .bay-folders .f-label{font-size:15px;flex-direction:column;gap:2px}
.flat .bay-folders .f-kind{text-align:left;max-width:none}
.flat .bay-folders .f-desc{-webkit-line-clamp:2;margin-top:0}
.flat .way-archive{left:var(--g);top:6px;width:110px;height:64px}
@media (min-width:900px){.flat .bay-folders .folders{grid-template-columns:repeat(4,minmax(0,1fr));max-width:1100px}}
