/* The Foundry's bedroom, in plain shapes. One explicit colour theme.
   2026-10-24 (her words): the bedroom became a room you stand in and turn round, with an arrow on either side. Four walls
   in plain CSS perspective, no library: the vanity wall (where you arrive), the bed wall, the window wall, the door wall.
   Then, the same evening: "nothing has dimension to it... the bed is flat against a wall. It doesn't take up space in the
   room." So the furniture came off the walls. Each piece is a small box of its own standing in the room's space (a PIECE:
   a point on the floor, with faces built round it from --bw, --bh, --bd), and only flat things stay on the walls: the
   mirror, the pictures, the window, the door. room.js sets --w and --h from the room's size and turns the cube. */
* { box-sizing: border-box; }
html { overflow-x: hidden; }   /* the room spills past its frame on purpose (see .room); the page hides the sideways part, the bars the rest */
body { margin: 0; background: #2a0a14; color: #f2e2c4; font: 18px/1.5 'Crimson Pro',Georgia,serif; }
main { max-width: 760px; margin: 0 auto; padding: 60px 14px 140px; }
.quiet { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stage { position: relative; cursor: grab; touch-action: pan-y; }
.stage:active { cursor: grabbing; }
.bar { position: fixed; background: #2a0a14; z-index: 5; pointer-events: none; }
.frame { position: absolute; inset: 0; border: 4px solid #c9a24b; border-radius: 10px; pointer-events: none; z-index: 6; }
.hots { position: absolute; inset: 0; z-index: 6; }
.hot { position: absolute; display: block; }
.hot[hidden] { display: none; }
/* her word, 30 October: the gold outlines "don't match what's actually there, and they look weird". A thing answers a mouse or
   the keyboard with a faint warm light inside its own touch shape (the hotspot, cut to the thing); a touch shows nothing,
   so a phone's first tap opens it (a tap that changed the page on its hover was taken as a hover, and needed a second) */
.hot.lit { background: #c9a24b40; }
.face a:focus-visible, .stage a:focus-visible { outline: none; }
/* the room is a box you look into from its open side; the walls are the four faces of a cube turned round you */
.room { --w: 732px; --h: 549px; --d: calc(var(--w) / 2); --floor: calc(var(--h) / 2); position: relative; width: 100%; aspect-ratio: 4 / 3; border: 4px solid transparent; border-radius: 10px; overflow: visible; background: #1a0610; perspective: calc(var(--w) * 1.1); perspective-origin: 50% 42%; }   /* the eye a little above the middle, so the tops of things show; no clip here, see the trap below */
/* YOU STAND IN THE MIDDLE (her words, 2026-10-24: "we need to be standing inside of the room"), so the near parts of the room
   project outside the frame. TRAP: any clip on an element above the cube (overflow, clip-path, contain) made Chrome paint
   whichever wall was on the left black. So nothing above the cube clips: the page hides sideways overflow, and room.js
   keeps four bars the colour of the page over the spill, fixed to the screen, with the gold frame drawn over everything. */
.cube { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(var(--turn, 0deg)); transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.cube.held { transition: none; }   /* while being dragged the room follows the hand at once */

/* two shades of wall, a baseboard and a rail along the top: the corners show as a change of plane and a break in the trim
   (her words, 2026-10-24: "you cannot tell where the corners of the rooms are when you're turning it") */
/* every wall, the floor and the ceiling run 2px past their edges, so neighbours overlap at the corners and seams: met edge
   to edge, the browser's smoothing let the room's backing through as stray pixels (2026-10-29; the Marble skin overlaps by
   4px on its own) */
.face { position: absolute; inset: -2px; background: #6d4a63; backface-visibility: hidden; overflow: hidden; box-shadow: inset 0 0 60px #2a0a1455; }
.face.e, .face.w { background: #5f3f57; }
.face::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4.5%; background: #4a2a3a; border-top: 3px solid #2a0a14; }
.face::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2.5%; background: #e9d9c0; border-bottom: 3px solid #2a0a14; }
.face.n { transform: rotateY(0deg) translateZ(calc(var(--d) * -1)); }
.face.e { transform: rotateY(-90deg) translateZ(calc(var(--d) * -1)); }
.face.s { transform: rotateY(180deg) translateZ(calc(var(--d) * -1)); }
.face.w { transform: rotateY(90deg) translateZ(calc(var(--d) * -1)); }
.face i { position: absolute; display: block; }
.ground, .ceiling { position: absolute; left: -2px; width: calc(100% + 4px); height: calc(var(--w) + 4px); top: 50%; margin-top: calc(var(--d) * -1 - 2px); }
.ground { background: #8a6a4a; background-image: repeating-linear-gradient(90deg, transparent 0 9%, #00000018 9% 10%); transform: rotateX(90deg) translateZ(calc(var(--floor) * -1)); }
.ceiling { background: #e9d9c0; transform: rotateX(-90deg) translateZ(calc(var(--floor) * -1)); }
/* the arrows on either side: turn left, turn right. Above the hotspots (z 6): under them a touch on an arrow went to the
   hotspot layer, so the right arrow did nothing and the left one opened whatever hung behind it (2026-10-29, the juror walk) */
.turn { position: absolute; top: 50%; width: 46px; height: 46px; margin-top: -23px; padding: 0; border: 2px solid #c9a24b; border-radius: 50%; background: #2a0a14cc; color: #c9a24b; font: bold 26px/1 'Crimson Pro',Georgia,serif; cursor: pointer; z-index: 7; }
.turn.left { left: 10px; } .turn.right { right: 10px; }
.turn:focus-visible { background: #4e1230; outline: none; box-shadow: 0 0 0 3px #4fb3a9; }
@media (hover: hover) { .turn:hover { background: #4e1230; box-shadow: 0 0 0 3px #4fb3a9; } }   /* a phone kept the hover lit after a tap */

/* ---- A PIECE: a thing with dimension, standing at a point on the floor ---------------------------------------
   --x and --z place it in the room (0 0 is the middle of the floor; x runs right, z runs toward you when facing the vanity),
   --y lifts it (0 is the floor; up is negative), --spin turns it to face a wall. Its faces are a box --bw wide, --bh tall
   and --bd deep, in --c. Faces are shaded as if the light came from above and a little from the left. */
.piece { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; transform: translate3d(var(--x, 0px), calc(var(--floor) + var(--y, 0px)), var(--z, 0px)) rotateY(var(--spin, 0deg)); }
/* a part of a piece starts from its parent's own point: custom properties inherit, so each is reset here or the part is moved twice (the table top vanished into the wall this way, 2026-10-24) */
.piece .piece { --x: 0px; --y: 0px; --z: 0px; --spin: 0deg; left: 0; top: 0; transform: translate3d(var(--x), var(--y), var(--z)) rotateY(var(--spin)); }
a.piece { display: block; color: inherit; text-decoration: none; }
.f { position: absolute; left: calc(var(--bw) / -2); top: calc(var(--bh) * -1); width: var(--bw); height: var(--bh); background: var(--c, #888); border: 3px solid #2a0a14; backface-visibility: hidden; }
.f.front { transform: translateZ(calc(var(--bd) / 2)); }
.f.back { transform: rotateY(180deg) translateZ(calc(var(--bd) / 2)); filter: brightness(.72); }
.f.left, .f.right { left: calc(var(--bd) / -2); width: var(--bd); }
.f.left { transform: rotateY(-90deg) translateZ(calc(var(--bw) / 2)); filter: brightness(.9); }
.f.right { transform: rotateY(90deg) translateZ(calc(var(--bw) / 2)); filter: brightness(.78); }
.f.top { top: calc(var(--bd) / -2); height: var(--bd); transform: translateY(calc(var(--bh) * -1)) rotateX(90deg); filter: brightness(1.12); }
a.piece.lit .f, a.piece:focus-visible .f { filter: brightness(1.18); }
.cube a, .cube a * { pointer-events: none; }
a.piece:focus-visible { outline: none; }

/* THE VANITY WALL: the mirror on the wall; the table, the jewelry box and the art box stand in front of it */
.mirror { position: absolute; left: 36%; top: 7%; width: 28%; height: 36%; background: #cfe3ea; border: 4px solid #c9a24b; border-radius: 50% 50% 8px 8px; }
.table { --x: 0px; --z: calc(var(--d) * -1 + var(--w) * .13); }
.table .slab { --y: calc(var(--h) * -.28); --bw: calc(var(--w) * .46); --bh: calc(var(--h) * .045); --bd: calc(var(--w) * .24); --c: #b47a3e; }
.table .slab .f.top { background: #e0b070; background-image: repeating-linear-gradient(90deg, transparent 0 14%, #00000012 14% 15%); }
.table .leg { --bw: calc(var(--w) * .018); --bh: calc(var(--h) * .28); --bd: calc(var(--w) * .018); --c: #5a3a22; }
.table .leg.a { --x: calc(var(--w) * -.21); --z: calc(var(--w) * -.1); } .table .leg.b { --x: calc(var(--w) * .21); --z: calc(var(--w) * -.1); }
.table .leg.c { --x: calc(var(--w) * -.21); --z: calc(var(--w) * .1); } .table .leg.d { --x: calc(var(--w) * .21); --z: calc(var(--w) * .1); }
.box { --x: calc(var(--w) * -.1); --y: calc(var(--h) * -.325); --z: calc(var(--d) * -1 + var(--w) * .13); --bw: calc(var(--w) * .14); --bh: calc(var(--h) * .08); --bd: calc(var(--w) * .1); --c: #c4477a; }
.box .dancer { --y: calc(var(--h) * -.08); --bw: calc(var(--w) * .025); --bh: calc(var(--h) * .06); --bd: 2px; --c: #fffdf6; }
.box .dancer .f { border-width: 2px; border-radius: 50% 50% 0 0; backface-visibility: visible; }
.caboodle { --x: calc(var(--w) * .1); --y: calc(var(--h) * -.325); --z: calc(var(--d) * -1 + var(--w) * .13); --bw: calc(var(--w) * .12); --bh: calc(var(--h) * .1); --bd: calc(var(--w) * .09); --c: #e38bb0; }
.caboodle .f.front { background: linear-gradient(180deg, #8fe0d6 0 42%, #f3a6c6 42% 100%); }
.caboodle .f.top { background: #8fe0d6; }
.caboodle .handle { --y: calc(var(--h) * -.1); --bw: calc(var(--w) * .05); --bh: calc(var(--h) * .025); --bd: 3px; --c: transparent; }
.caboodle .handle .f { border-bottom: 0; border-radius: 8px 8px 0 0; }

/* THE BED WALL: the corkboard hung over the bed (her word, 2026-10-24); the bed along the wall, the doll standing on it */
.bed { --x: calc(var(--d) - var(--w) * .15); --z: calc(var(--w) * -.06); --spin: -90deg; --bw: calc(var(--w) * .5); --bh: calc(var(--h) * .14); --bd: calc(var(--w) * .3); --c: #f2e2c4; }
.bed .f.top { background: linear-gradient(90deg, #fffdf6 0 30%, #b63f7a 30% 100%); }
.bed .pillow { --x: calc(var(--w) * -.17); --y: calc(var(--h) * -.14); --bw: calc(var(--w) * .13); --bh: calc(var(--h) * .05); --bd: calc(var(--w) * .2); --c: #fffdf6; }
.bed .pillow .f { border-radius: 8px; }
.bed .head { --z: calc(var(--w) * -.14); --bw: calc(var(--w) * .5); --bh: calc(var(--h) * .3); --bd: calc(var(--w) * .02); --c: #7a5230; }
.bed .head .f.front { border-radius: 10px 10px 0 0; }
.doll { --x: calc(var(--d) - var(--w) * .13); --y: calc(var(--h) * -.14); --z: calc(var(--w) * .04); --spin: -55deg; --bw: calc(var(--w) * .07); --bh: calc(var(--h) * .22); --bd: 0px; }
.doll .f { background: none; border: 0; backface-visibility: visible; }
.doll .f i { position: absolute; display: block; }
.doll .f .hd { left: 22%; top: 0; width: 56%; aspect-ratio: 1; background: #f2c9a3; border: 3px solid #2a0a14; border-radius: 50%; }
.doll .f .dress { left: 0; right: 0; top: 34%; bottom: 0; background: #fffdf6; border: 3px solid #2a0a14; clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }
.doll.lit .f .dress, .doll:focus-visible .f .dress { background: #ffe9a8; }
.corkwall { position: absolute; left: 26%; top: 8%; width: 48%; height: 40%; display: block; background: #b9855a; border: 6px solid #5a3a22; border-radius: 3px; box-shadow: 4px 6px 8px #0008; z-index: 1; }
.corkwall i { position: absolute; display: block; }
.corkwall .pin { width: 7%; aspect-ratio: 1; border-radius: 50%; background: #d23a2e; box-shadow: 0 1px 2px #0009; }
.corkwall .pin.a { left: 14%; top: 18%; } .corkwall .pin.b { left: 62%; top: 12%; background: #8a8a92; } .corkwall .pin.c { left: 40%; top: 58%; background: #e2b06a; } .corkwall .pin.d { left: 80%; top: 50%; }
.corkwall .str { height: 2px; background: #b3261e; transform-origin: 0 50%; }
.corkwall .str.a { left: 18%; top: 23%; width: 48%; transform: rotate(-6deg); }
.corkwall .str.b { left: 44%; top: 62%; width: 40%; transform: rotate(-16deg); }
.corkwall .str.c { left: 18%; top: 23%; width: 42%; transform: rotate(52deg); }


/* THE WINDOW WALL: the window on the wall; the boom box on the floor under it */
.window { position: absolute; left: 36%; top: 10%; width: 28%; height: 40%; background: #1d2a4a; border: 4px solid #f2e2c4; }
.window i { left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: #f2e2c4; }
.boom { --x: calc(var(--w) * -.22); --z: calc(var(--d) - var(--w) * .07); --spin: 180deg; --bw: calc(var(--w) * .27); --bh: calc(var(--h) * .17); --bd: calc(var(--w) * .1); --c: #55555f; }
.boom .f.front { border-radius: 8px; }
.boom .f.front i { position: absolute; display: block; }
.boom .f.front .spk { top: 18%; width: 24%; aspect-ratio: 1; background: #2a1c2e; border: 3px solid #c9c9d1; border-radius: 50%; }
.boom .f.front .spk.l { left: 6%; } .boom .f.front .spk.r { right: 6%; }
.boom .f.front .deck { left: 36%; right: 36%; top: 26%; height: 40%; background: #f2e2c4; border: 3px solid #2a0a14; }

/* the calendar hung beside the window (2026-10-25): a paper sheet on rings, a strip of months and a grid of days */
.wallcal { position: absolute; left: 9%; top: 40%; width: 19%; height: 32%; display: block; background: #fffdf6; border: 2px solid #2a1c2e; border-radius: 2px; box-shadow: 3px 5px 7px #0008; transform: rotate(-1.5deg); z-index: 1; }
.wallcal i { position: absolute; display: block; }
.wallcal .rings { left: 10%; right: 10%; top: -6px; height: 10px; background: repeating-linear-gradient(90deg, #c9a24b 0 4px, transparent 4px 14px); }
.wallcal .sheet { left: 8%; right: 8%; top: 30%; bottom: 8%; background: linear-gradient(#7a2e55 0 0) 0 -12% / 100% 14% no-repeat, repeating-linear-gradient(90deg, #d9c9a8 0 1px, transparent 1px 14.28%), repeating-linear-gradient(180deg, #d9c9a8 0 1px, transparent 1px 20%); }
.wallcal::before { content: ""; position: absolute; left: 8%; right: 8%; top: 9%; height: 14%; background: #c4477a; }


/* THE DOOR WALL: the bedroom door, flat in its frame, with the pictures hung all round it, frame to frame (her word, 2026-10-24) */
.exit { position: absolute; left: 43%; bottom: 0; width: 14%; height: 60%; background: #7a5230; border: 4px solid #2a0a14; border-bottom: 0; border-radius: 40px 40px 0 0; z-index: 2; display: block; }
.exit .knob { position: absolute; left: 14%; top: 54%; width: 18%; aspect-ratio: 1; border-radius: 50%; background: #c9a24b; display: block; }
.exit.lit, .exit:focus-visible { background: #8a6240; outline: none; }
.wallpics { position: absolute; left: 10%; top: 5%; width: 80%; height: 70%; display: block; z-index: 1; }
.wallpics .p { position: absolute; border: 3px solid #c9a24b; box-shadow: 3px 5px 6px #0008; }
.wallpics .p.a { left: 2%; top: 6%; width: 18%; height: 30%; background: #d8508f; transform: rotate(-3deg); }
.wallpics .p.b { left: 23%; top: 2%; width: 16%; height: 20%; background: #4fb3a9; border-color: #2a0a14; transform: rotate(2deg); }
.wallpics .p.c { left: 42%; top: 4%; width: 16%; height: 32%; background: #f2e2c4; border-color: #2a0a14; border-radius: 50%; transform: rotate(-2deg); }
.wallpics .p.d { left: 61%; top: 2%; width: 20%; height: 22%; background: #8a63c9; transform: rotate(1.5deg); }
.wallpics .p.e { left: 4%; top: 42%; width: 22%; height: 34%; background: #e2b06a; border-color: #2a0a14; transform: rotate(2deg); }
.wallpics .p.g { left: 72%; top: 30%; width: 24%; height: 34%; background: #c4477a; border-color: #f2e2c4; transform: rotate(-3deg); }
.wallpics .p.h { left: 83%; top: 4%; width: 14%; height: 22%; background: #4fb3a9; transform: rotate(4deg); }
.wallpics .p.k { left: 6%; top: 80%; width: 20%; height: 18%; background: #f2e2c4; border-color: #2a0a14; transform: rotate(-2deg); }
.wallpics .note { position: absolute; left: 24%; top: 28%; width: 13%; height: 18%; background: #fffdf6; border: 2px solid #d9c9a8; transform: rotate(-6deg); box-shadow: 2px 3px 4px #0007; }
.wallpics .note::before { content: ""; position: absolute; left: 30%; top: -5px; width: 40%; height: 8px; background: #e6d7a7cc; }
.wallpics.lit .p, .wallpics:focus-visible .p { border-color: #fffdf6; }

/* the four corner probes room.js puts inside every wall link (b.pt): a pixel at each corner, so the browser can say where
   the corners are on screen and the hotspot can be cut to that shape. Not i, so the skins' picture rules never touch them. */
.face a > b.pt { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; border: 0; background: none; pointer-events: none; }
.face a > b.pt.tl { left: 0; top: 0; } .face a > b.pt.tr { right: 0; top: 0; } .face a > b.pt.br { right: 0; bottom: 0; } .face a > b.pt.bl { left: 0; bottom: 0; }
/* the scraps that are doors (2026-10-27: the papers are what we are thinking, the polaroids are who we are) light like the rest */
.face a.scrap { display: block; color: inherit; text-decoration: none; }

/* what the doorknob says (room.js): a paper bubble over the door, gone again in a moment */
.knobsay { position: absolute; z-index: 7; max-width: 230px; padding: 8px 12px; transform: translate(-50%, -100%); background: #fffdf6; color: #2a0a14; border: 2px solid #2a0a14; border-radius: 14px; font: italic 16px/1.3 'Crimson Pro', Georgia, serif; box-shadow: 3px 5px 7px #0007; pointer-events: none; animation: knobpop .25s cubic-bezier(.2, 1.4, .4, 1); }
.knobsay::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; margin-left: -7px; background: #fffdf6; border-right: 2px solid #2a0a14; border-bottom: 2px solid #2a0a14; transform: rotate(45deg); }
.knobsay.gone { opacity: 0; transition: opacity .35s; }
@keyframes knobpop { from { transform: translate(-50%, -80%) scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .knobsay { animation: none; } }
@media (prefers-reduced-motion: reduce) { .cube { transition: none; } }
