/* A room: a page seen from inside. It is a wall page (wall.css, wall.js) with
   one stretch, as wide as the window or wider and travelled the same way
   where it is wider, so its lettering, its sponge and its can are the
   street's. The room is drawn by core/rig/walls/room.py; its faces are
   coloured here, from four variables, so a room is restyled by setting
   them (the account's Room tab does):

     --room-wall     the walls; the ceiling is a paler mix of it
     --room-floor    the planks
     --room-accent   the rug, and the colour things on the wall are picked out in
     --room-bed      the blanket on the bed

   (The way to a room from the street is up the founder's fire escape:
   wall.css, "up the ladder".) */
body.wall-room {
    --room-wall: #e9dcc4;
    --room-floor: #a9794c;
    --room-accent: #e3407c;
    --room-bed: #1f3358;
    --room-ink: #1f2330;     /* small words on the wall: white where the wall is dark */
    --wall-fill: #1f2330;
    --dirt: 28vh;        /* the floor */
}
.room {
    --span: max(100vw, 160vh);
    --top: 10vh;
    --edge: 10vh;
    /* What is on the back wall stays between the bed's head and the desk. (Shares of the room's own
       width, said through --span: a per cent here is of the whole house's length, not the room's.) */
    padding: 12vh calc(var(--span) * 0.34) 30vh calc(var(--span) * 0.35);
    background: none;
}
.room::after { content: none; }      /* no wall's light: a room has its own faces */

.roomShell { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
.roomShell .rw { --c: var(--room-wall); }
.roomShell .rl { --c: color-mix(in srgb, var(--room-wall), #000 17%); }
.roomShell .rr { --c: color-mix(in srgb, var(--room-wall), #000 9%); }
.roomShell .rc { --c: color-mix(in srgb, var(--room-wall), #fff 46%); }
.roomShell .rf { --c: var(--room-floor); }
.roomShell .rg { --c: var(--room-accent); }
.roomShell .rd { --c: var(--room-bed); }
.roomShell .rg--in { --c: color-mix(in srgb, var(--room-accent), #fff 22%); }
.roomShell .rg--mid { --c: color-mix(in srgb, var(--room-accent), #000 14%); }
/* a face's own shade of its surface */
.roomShell .s0 { fill: var(--c); }
.roomShell .s1 { fill: color-mix(in srgb, var(--c), #fff 6%); }
.roomShell .s2 { fill: color-mix(in srgb, var(--c), #fff 12%); }
.roomShell .s3 { fill: color-mix(in srgb, var(--c), #000 5%); }
.roomShell .s4 { fill: color-mix(in srgb, var(--c), #000 10%); }
.roomShell .rj { fill: #000; opacity: 0.16; }
.roomShell .rp { fill: color-mix(in srgb, var(--room-wall), #fff 55%); }
.roomShell .rb { fill: color-mix(in srgb, var(--room-wall), #fff 62%); }
.roomShell .rb--top { fill: #fff; opacity: 0.55; }
.roomShell .rb--side { fill: color-mix(in srgb, var(--room-wall), #fff 38%); }
.roomShell .rs { fill: #fff; opacity: 0.1; }
.roomShell .rk { fill: #2b2e34; }
.roomShell .rk--lit { fill: #454a53; }
.roomShell .rk--glow { fill: #ffe9a8; }

/* What stands in it (the bed in one corner, the desk in the other, the shelf) is part of the
   room's picture, so it keeps to the room's walls whatever shape the window is. */
/* The window: the way out (onto the fire escape) or just the weather. Over the bed's head. */
.roomWindow { position: absolute; z-index: 2; left: 13.5%; top: 12vh; height: 33vh; aspect-ratio: 300 / 400; }
.roomWindow img { position: relative; display: block; width: 100%; height: 100%; }
/* Behind the frame, where the glass is: the sky, clouds and a bird going by, the roofs across the street. */
.roomView { position: absolute; left: 7.33%; top: 7.5%; width: 85.34%; height: 76.5%; overflow: hidden; background: url("../img/street/room-view.svg?v=1") 0 0 / 100% 100% no-repeat; }
.roomCloud { position: absolute; left: 0; top: 14%; width: 62%; aspect-ratio: 17 / 6.4; background: linear-gradient(172deg, #ffffff 0 58%, #d9e5f2 58.2% 100%); clip-path: polygon(5% 100%, 0 86%, 2% 70%, 9% 58%, 17% 54%, 19% 38%, 27% 26%, 37% 24%, 42% 11%, 53% 2%, 65% 2%, 75% 11%, 80% 28%, 88% 34%, 94% 46%, 97% 62%, 100% 78%, 99% 92%, 95% 100%); animation: roomDrift 52s linear infinite; --to: 170%; }
.roomCloud:nth-child(2) { top: 40%; width: 44%; animation-duration: 74s; animation-delay: -31s; --to: 236%; }
.roomCloud:nth-child(3) { top: 3%; width: 34%; animation-duration: 96s; animation-delay: -62s; --to: 300%; }
@keyframes roomDrift { from { transform: translateX(-105%); } to { transform: translateX(var(--to)); } }
.roomBird { position: absolute; left: 0; top: 30%; width: 7%; aspect-ratio: 2 / 1; background: #1f2330; clip-path: polygon(0 20%, 26% 0, 50% 52%, 74% 0, 100% 20%, 74% 30%, 50% 100%, 26% 30%); animation: roomFlies 23s linear infinite; }
@keyframes roomFlies { 0% { transform: translate(1500%, 60%); } 38% { transform: translate(-150%, -90%); } 100% { transform: translate(-150%, -90%); } }
.roomRoofs { position: absolute; left: 0; right: 0; bottom: 0; height: 32.7%; background: url("../img/street/room-roofs.svg?v=1") 0 0 / 100% 100% no-repeat; }
a.roomWindow { transition: filter 0.2s ease; }
a.roomWindow:hover, a.roomWindow:focus-visible { filter: brightness(1.08) drop-shadow(0 0 1.4vh rgb(255 255 255 / 0.5)); outline: none; }

/* What is on the back wall. Small words are in the room's ink: ink on a pale wall, white on a dark one. */
.room .wallHold { gap: 1.6vh; }
.room .wallBy, .room .wallTag { color: var(--room-ink, var(--ink)); }
.room .wallBy a { color: inherit; }
/* A picture in a frame: two tones of wood, hung a little off level. */
.roomFrame { display: block; padding: 1.3vh; background: linear-gradient(135deg, #a47f52 0 50%, #7a5a3c 50.2% 100%); box-shadow: 0.7vh 0.9vh 0 rgb(0 0 0 / 0.18); rotate: -2deg; transition: rotate 0.25s ease; }
.roomFrame img { display: block; height: 30vh; width: auto; max-width: 100%; object-fit: cover; outline: 0.5vh solid #f7f0e1; outline-offset: -0.5vh; }
a.roomFrame:hover, a.roomFrame:focus-visible { rotate: 1deg; outline: none; }

.roomSmall { font-size: clamp(26px, 5vh, 50px); }

/* ---- a house: rooms in a row, gone along as the street is (main/room/jens.blade.php) ---- */
/* The wall between two rooms, seen end on. */
/* (the wall between two rooms is drawn in each room's picture, half in each: room.py, wallend. This is only what hides a hair of light where the two pictures meet.) */
.room + .room::before { content: ""; position: absolute; z-index: 3; left: -1px; top: 0; bottom: 0; width: 2px; background: #a44a32; pointer-events: none; }
/* A door through to the next room, and the computer where it is on: things to press, and they say so. */
.roomDoor, .roomScreen { cursor: pointer; outline: none; transition: filter 0.18s ease; }
.roomDoor:hover, .roomDoor:focus-visible { filter: brightness(1.16); }
/* (the plate on a door: the next room's name, flat on the door) */
.roomSignGlow { fill: var(--room-accent); opacity: 0.8; }
.roomSignSays { font-family: var(--font-spray); fill: #f4f1ea; stroke: #f4f1ea; stroke-width: 0.9; vector-effect: non-scaling-stroke; }
.roomDoor:hover .roomSignGlow, .roomDoor:focus-visible .roomSignGlow { opacity: 1; }
.roomScreen { filter: drop-shadow(0 0 1.1vh rgb(93 255 154 / 0.5)); }
.roomScreen:hover, .roomScreen:focus-visible { filter: brightness(1.5) drop-shadow(0 0 2vh rgb(93 255 154 / 0.85)); }
.roomCaret { animation: roomCaret 1.1s steps(1, end) infinite; }
@keyframes roomCaret { 50% { opacity: 0; } }
/* A room that is for what is on its wall: the wall is its, between the doors, down to what stands along its foot. */
.room--wide { padding: 12vh calc(var(--span) * 0.15) 45vh; }
/* (the room you write from: what stands in it is off to one side, and the form has the wall down to the skirting) */
#contact.room--wide { padding-bottom: 31vh; padding-right: calc(var(--span) * 0.3); padding-left: calc(var(--span) * 0.22); }
.room--wide .wallHold { gap: 1.5vh; width: 100%; }
.room--wide .wallHold > .wallHead { font-size: clamp(38px, min(10vh, 7.4vw), 100px); }
/* Small words in a room: our hand, sprayed, in the room's ink; what is picked out is in its colour. */
.houseSmall, .houseSkill, .houseTasks { margin: 0; font-family: var(--font-spray); letter-spacing: 0.035em; word-spacing: 0.12em; color: var(--room-ink, var(--ink)); filter: url(#spray); }
.houseSmall { font-size: clamp(15px, 2.5vh, 24px); line-height: 1.14; }
.houseSmall span { font-family: inherit; }
.houseSkill { font-weight: 400; font-size: clamp(22px, 3.9vh, 38px); line-height: 1; }
/* Work: each job's banner in a frame, what he was and when under it, what the job was over it under the pointer. */
.houseJobs { display: grid; grid-template-columns: repeat(3, minmax(0, 44vh)); justify-content: center; gap: 1.6vh 2.4vw; width: 100%; }
.houseJob { position: relative; outline: none; text-align: left; }
/* A banner's corners are round, every banner's the same (the pictures' own differ, and two have
   none), and what is round it is round to match: the frame's corner is the banner's, a frame's
   width further out. */
.houseJobShow { position: relative; padding: 2.1%; border-radius: 5.7% / 16.5%; background: linear-gradient(135deg, #a47f52 0 50%, #7a5a3c 50.2% 100%); box-shadow: 0.6vh 0.8vh 0 rgb(0 0 0 / 0.18); }
.houseJobShow img { display: block; width: 100%; height: auto; border-radius: 3.85% / 11.6%; }
.houseJobShow--us { aspect-ratio: 3.18 / 1; display: flex; align-items: center; justify-content: center; gap: 4%; }
.houseJobShow--us::before { content: ""; position: absolute; inset: 0; margin: 2.1%; border-radius: 3.85% / 11.6%; background: #1f2330; }
.houseJobShow--us > * { position: relative; }
.houseJobShow--us img { width: auto; height: 62%; aspect-ratio: 1; border-radius: 0; }
.room .houseJobShow--us .wallHead { font-size: clamp(20px, 4.4vh, 46px); }
.houseJob > .houseSmall { margin-top: 0.7vh; }
.houseJob > .houseSmall span { margin-left: 0.5em; color: var(--room-accent); white-space: nowrap; }
.houseTasks { position: absolute; z-index: 6; inset: 0 0 auto; min-height: 100%; border-radius: 5.7% / 12%; padding: 1.2vh 1.1vw 1.2vh 2.2vw; list-style: square; font-size: clamp(13px, 2.1vh, 20px); line-height: 1.16; color: #f4f1ea; background: #1f2330; opacity: 0; pointer-events: none; transition: opacity 0.14s ease; filter: none; }
.houseTasks li { filter: url(#spray); }
.houseTasks li::marker { color: var(--room-accent); }
.houseJob:hover .houseTasks, .houseJob:focus .houseTasks { opacity: 1; }
/* (the list is over the frame, so it is the list that throws the shade: the frame's own would show round its side) */
.houseTasks { box-shadow: 0.6vh 0.8vh 0 rgb(0 0 0 / 0.18); }
.houseJob:hover .houseJobShow, .houseJob:focus .houseJobShow { box-shadow: none; }
/* Expertise: what he works in, a field a list. */
.houseSkills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.8vh 2.2vw; width: 100%; text-align: left; }
.houseSkills .houseSkill { margin-bottom: 0.15em; color: var(--room-accent); }
.houseSkills .houseSmall span:not(:last-child)::after { content: " /"; color: var(--room-accent); }
/* Labs: a card each, dark, the room's colour down its edge. */
.houseLabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.8vh 1.8vw; width: 100%; text-align: left; }
.houseLab { display: block; padding: 1.7vh 1.4vw 2vh; text-decoration: none; background: #1f2330; border-left: 1vh solid var(--room-accent); box-shadow: 0.6vh 0.8vh 0 rgb(0 0 0 / 0.18); transition: border-left-width 0.14s ease; }
.houseLab:hover, .houseLab:focus-visible { border-left-width: 2.2vh; outline: none; }
.houseLab .houseSkill { margin-bottom: 0.2em; color: #f4f1ea; }
.houseLab .houseSmall { color: #d9d5ca; }
/* Links: his name for each place, painted, two to a row. */
/* (a link is written in the hand, in the room's ink, with where it goes under it: the bubble letters are the room's title and nothing else's) */
.houseLinks { margin: 1vh 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 3.2vh 4.5vw; text-align: left; }
.houseLink { display: block; text-decoration: none; outline: none; }
.houseLink .houseSkill, .houseLink .houseSmall { display: block; }
.houseLink .houseSkill { font-size: clamp(28px, 6.2vh, 60px); transition: color 0.14s ease; }
.houseLink .houseSmall { color: var(--room-accent); }
.houseLink:hover .houseSkill, .houseLink:focus-visible .houseSkill { color: var(--room-accent); }
.room .wallMark { width: min(100%, 560px); }
.room .wallMark label { color: var(--room-ink, var(--ink)); }

/* ---- the account: your room. Who you are, three tabs, and what each holds ---- */
.wall-account .wallTabs { display: none; }       /* you are already here */
/* (what he says of himself, under his name: a block, read from its left) */
.roomAbout { width: 100%; margin-top: 0.8vh; text-align: left; text-wrap: pretty; }
.roomWho { display: flex; align-items: center; gap: 2.2vh; }
.roomWho .wallHead { font-size: clamp(34px, min(9.5vh, 6.5vw), 100px); }
.roomIcon { flex: 0 0 auto; width: 11vh; height: 11vh; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; box-shadow: 0 0 0 0.45vh var(--ink), 0 0 0 1vh var(--room-accent); }
.roomIcon span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--ink) center / cover no-repeat; transition: filter 0.2s ease; }
.roomIcon:hover span, .roomIcon:focus-visible span { filter: brightness(0.72); }
.roomIcon:focus-visible { outline: none; }
/* The tabs are sprayed words; the one you are on is the big one. */
.roomTabs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.4vh 2.4vw; }
.roomTabs input { position: absolute; opacity: 0; pointer-events: none; }
.roomTabs label, .roomOut { font-size: clamp(19px, 3.3vh, 32px); cursor: pointer; opacity: 0.5; text-decoration: none; transition: opacity 0.15s ease, scale 0.15s ease; }
.roomTabs label:hover, .roomOut:hover, .roomOut:focus-visible { opacity: 1; outline: none; }
.roomTabs input:checked + label { opacity: 1; scale: 1.22; }
.roomTabs input:focus-visible + label { outline: 2px dashed currentColor; outline-offset: 4px; }
.roomOut { margin-left: 1.6vw; }
.roomSays .wallBy { font-size: clamp(16px, 2.6vh, 24px); }
.roomSays.error .wallBy { color: #d23a31; }
.roomSays.success .wallBy { color: #2f8a46; }
.roomPanels { width: 100%; min-height: 23vh; }
/* A field is a pass of a roller in the room's ink, and what is in it shows the wall through. */
.roomForm { display: grid; gap: 0.5vh; width: min(100%, 470px); margin: 0 auto; text-align: left; }
.roomForm label { font-size: clamp(16px, 2.5vh, 23px); margin-top: 0.4vh; }
.roomForm .inputContainer { position: relative; }
.roomForm .inputContainer::before { content: ""; position: absolute; inset: -3px -10px; background: var(--room-ink, var(--ink)); filter: url(#roller); rotate: -0.5deg; }
.roomForm input { position: relative; width: 100%; padding: 0.5vh 12px; font-family: var(--font-spray); font-size: clamp(22px, 3.8vh, 36px); line-height: 1.12; color: var(--room-wall); caret-color: var(--room-accent); background: none; border: 0; border-radius: 0; filter: url(#spray); }
.roomForm input:focus { outline: none; }
.roomForm .inputContainer:focus-within::before { box-shadow: 0 6px 0 -1px var(--room-accent); }
.roomRow { display: flex; flex-wrap: wrap; justify-content: center; gap: 1vh 2.4vw; margin-top: 2.4vh; }
.roomRow form { margin: 0; }
/* A button is a few words sprayed on a blot. */
.roomBtn { position: relative; isolation: isolate; display: inline-block; padding: 0.6vh 1.6vw 0.8vh; font-family: var(--font-spray); font-size: clamp(19px, 3.2vh, 30px); line-height: 1.1; color: var(--room-wall); text-decoration: none; background: none; border: 0; cursor: pointer; }
.roomBtn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--room-ink, var(--ink)); -webkit-mask: var(--sprayed) 0 0 / 100% 100% no-repeat; mask: var(--sprayed) 0 0 / 100% 100% no-repeat; }
.roomBtn:hover::before, .roomBtn:focus-visible::before { background: var(--room-accent); }
.roomBtn:focus-visible { outline: none; }
.roomBtn--end { color: #fff; }
.roomBtn--end::before, .roomBtn--end:hover::before { background: #c8322b; }
.roomWarn { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1vh 1.6vw; }
.roomWarn form { margin: 0; }
/* Room: a blot of each paint; the one in use is the big one with a ring. */
/* The room's colours: a strip of them for each part of it, up where that part was pressed
   (main/account/script.js). A dark blot behind, sprayed like the street's grounds. */
.roomPicks { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.roomPick { position: absolute; display: none; isolation: isolate; flex-wrap: nowrap; align-items: center; gap: 1.1vh; padding: 1.5vh 2.2vh; translate: -50% 0; pointer-events: auto; }
.roomPick.is-open { display: flex; }
.roomPick::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #1f2330; -webkit-mask: var(--sprayed) 0 0 / 100% 100% no-repeat; mask: var(--sprayed) 0 0 / 100% 100% no-repeat; }
.roomPick button { flex: 0 0 auto; width: 4.2vh; height: 4.2vh; padding: 0; border: 0; border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%; background: var(--c); box-shadow: 0 0 0 0.3vh #f7f0e1; cursor: pointer; transition: scale 0.14s ease; }
.roomPick button:hover, .roomPick button:focus-visible { scale: 1.12; outline: none; }
.roomPick button[aria-pressed="true"] { scale: 1.22; box-shadow: 0 0 0 0.3vh #f7f0e1, 0 0 0 0.75vh var(--pink, #e3407c); }
/* In your own room what can be restyled says so under the pointer. */
.wall-account .roomShell :is(.rw, .rl, .rr, .rc, .rb, .rf, .rg, .rd) { cursor: pointer; }

/* Cropping a new icon: a sheet over the room. */
#cropModal { position: fixed; inset: 0; z-index: 40; display: none; place-items: center; background: rgb(16 12 10 / 0.74); }
#cropModal.active { display: grid; }
#cropContent { display: grid; gap: 1.4vh; width: min(92vw, 560px); padding: 2.4vh min(2.4vw, 24px); color: #1f2330; background: #f1e3c6; }
#cropContent h3 { margin: 0; font-family: var(--font-tag); font-size: 22px; font-weight: 700; }
.cropArea { max-height: 52vh; overflow: hidden; }
.cropArea img { display: block; max-width: 100%; }
.cropPreviewWrap { display: flex; align-items: center; gap: 12px; font-family: var(--font-tag); font-weight: 600; }
#cropPreview { width: 72px; height: 72px; overflow: hidden; border-radius: 50%; }
.cropActions { display: flex; justify-content: flex-end; gap: 10px; }
.cropActions button { padding: 6px 18px; font-family: var(--font-tag); font-size: 18px; font-weight: 700; color: #f7f0e1; background: #1f2330; border: 0; cursor: pointer; }
.cropActions #cropConfirm { background: #e3407c; }

@media (hover: none), (pointer: coarse) {
    .room { min-width: 0; padding: 12vh calc(var(--span) * 0.3) 30vh; }
    /* what is on the back wall is no wider than the window it is seen through */
    .room .wallHold { width: 92vw; max-width: 92vw; flex: 0 0 auto; }
    .roomWho .wallHead { font-size: min(8vh, 11vw); }
    /* (a room of the house is read along, as the street is: six jobs in one window's width come out too small to read) */
    .room--wide { padding: 12vh calc(var(--span) * 0.18) 45vh; }
    .room--wide .wallHold { width: 100%; max-width: none; }
    #contact.room--wide, #links.room--wide { padding: 12vh calc(var(--span) * 0.3) 45vh; }
    #contact.room--wide .wallHold, #links.room--wide .wallHold { width: 92vw; max-width: 92vw; }
    .houseLinks { grid-template-columns: auto; }
    .roomIcon { width: 9vh; height: 9vh; }
}
@media (prefers-reduced-motion: reduce) {
    .roomCloud, .roomBird { animation: none; }
    .roomCloud { transform: translateX(30%); }
    .roomBird { display: none; }
    .room { display: flex; height: 100vh; min-height: 0; padding: 12vh calc(var(--span) * 0.3) 30vh; }
}
