/* ==========================================================================
   Landing page only (index.html), v3. Link after styles.css and css/motion.css.

   Every part uses the whole window and carries very little:
   1. First screen: tiny header, the name, three short sentences, a room (four frames, a lamp, a cat)
   2. Kinetic type band, full width
   3. Experience: one full-screen stage with large 3D objects
   4. Closing block (contact, about, two services)
   5. Project dialog

   State on <html>:
     .js      the head snippet ran
     .motion  scroll-driven layouts are on (not reduced motion, GSAP loaded)
     data-room="evening"   the lamp is on: the whole site is in evening light (tokens in styles.css).
                           Rules here that start with html[data-room="evening"] only say what the
                           tokens cannot: the room itself, and the drawn objects further down.
   ========================================================================== */

.landing {
  --paper: var(--paper-home);             /* one calm page colour, a shade deeper so objects lift off it (#e3e1dc; evening #2f2a25) */
  --edge: clamp(16px, 2.4vw, 40px);       /* distance of the small corner texts from the window edge */
  background: var(--paper);
}

/* 1. First screen: a room -------------------------------------------------------- */
/* A wall, a wooden floor, four frames, a floor lamp and a cat asleep on a cushion. The floor, the
   lamp, the cat, its cushion and the rug are rendered images (img/room/, made in Blender; scripts in
   blender/room/). The wall, its light and every shadow on it are CSS. Everything that draws the
   room (.wall) sits behind the text and takes no clicks. The lamp is a button: it sets
   data-room="evening" on <html> (js/motion.js, part 7b). Day is the default and the only state
   without the script.

   One length sets the scale of every rendered object: --lb, the height of the lamp's image box
   (2400 image px; the lamp itself is 0.8925 of it, 1.53 m). All the factors below are image px
   divided by 2400, so the lamp, the cat, the rug, the pool of light and the boards of the floor
   keep one physical scale at any window size. To move things, change these, not the factors:
     --lb       scale of the room's objects
     --floor-h  how much of the floor shows at the foot of the screen (the skirting is its top edge)
     --pet-k    the cat, cushion and rug can be a little over life size (1 to 1.25)
     --row-w    width of the row of frames. The lamp stands beside the row (--lamp-w, --side-gap).
                The cat lies in front of the wall under the last frame (Google Keep), just right of
                that frame's label (--keep-label, --cat-gap), so its rug reaches --cat-over past the
                end of the row. Lamp, row and that overhang are centred as one group between
                --mx-l and --mx-r.
     --lamp-a / --lamp-dx   where the lamp's foot stands: an anchor (50% or 0%) plus a length
     --pet-a / --pet-dx     the same for the middle of the cushion
     --lamp-k   the lamp alone can be drawn larger than the room's scale (phones)
     --name-fs  size of the name (the intro line keeps clear of its descender by a share of it)
     --line     the line the bottoms of the frames hang on, in % of the row (see .hang)
   By day the lamp is off and soft daylight comes from the upper left; in
   the evening the lamp is the only light. Either way the light is on the left, so every shadow
   falls to the right. Each frame carries how the light reaches it: --sx / --sy (shadow offset),
   --lit (brightness in the evening). */
@property --name-a { syntax: '<color>'; inherits: true; initial-value: #141414; }
@property --name-b { syntax: '<color>'; inherits: true; initial-value: #141414; }

.landing { --room-t: 0.75s; --room-ease: cubic-bezier(0.4, 0, 0.2, 1); }

.hero2 {
  --lb: clamp(15rem, min(64svh, 40vw), 42rem);
  --floor-h: clamp(6.5rem, 19svh, 14rem);
  --pet-k: 1;
  --lamp-k: 1;
  --lamp-lb: calc(var(--lb) * var(--lamp-k));               /* the lamp's own image box */
  --lamp-w: calc(var(--lamp-lb) * 0.2325);                  /* the shade */
  --pw: calc(var(--lb) * 0.714 * var(--pet-k));             /* the cat image, 1600 x 1200 */
  --rw: calc(var(--lb) * 0.679 * var(--pet-k));             /* the rug image, 2000 x 460, drawn at 0.76 of its true size: a small rug */
  --rug-r: calc(var(--rw) * 0.528);                         /* the rug, right of the middle of the cushion */
  --cat-l: calc(var(--lb) * 0.15 * var(--pet-k));           /* the cat, left of the middle of the cushion */
  --cat-r: calc(var(--lb) * 0.19 * var(--pet-k));           /* the cushion, right of its middle */
  --cat-w: calc(var(--cat-l) + var(--cat-r));
  --cat-rise: calc(var(--lb) * 0.118 * var(--pet-k));       /* how far the cat stands above the skirting */
  --side-gap: clamp(0.9rem, 1.7vw, 2.25rem);
  --mx: calc(var(--edge) * 1.45);
  --mx-l: 4vw; --mx-r: 2.5vw;                                /* the lamp and the rug keep this far from the window's edges */
  /* the Google Keep frame is the last in the row (--keep-w of it); its label is about 11.6 of its
     own font size wide. The cat's head clears the label by --cat-gap. */
  --placard-fs: clamp(0.65625rem, 0.56rem + 0.15vw, 0.75rem);
  --keep-w: 0.215; --keep-label: calc(var(--placard-fs) * 11.6); --cat-gap: 1.1rem;
  --cat-out: calc(var(--keep-label) + var(--cat-gap) + var(--cat-l) + var(--rug-r));   /* from the left edge of that frame to the right edge of the rug */
  --pad-t: clamp(4.5rem, 9.6svh, 7.75rem);
  --pad-b: clamp(0.9rem, 2.2svh, 1.75rem);
  --name-fs: min(var(--step-display), 17.5svh);
  --lede-m: max(clamp(1.35rem, 3.4svh, 2.1rem), var(--name-fs) * 0.25);
  --gal-pad: clamp(1rem, 3svh, 2.4rem);
  /* what is left for the frames between the intro line and the skirting: the name (0.8 of its size),
     three lines of intro (4.2rem), a label of four lines with its margin (5.9rem) */
  --wall-h: calc(100svh - var(--floor-h) - var(--pad-t) - var(--name-fs) * 0.8 - var(--lede-m) - 4.2rem - var(--gal-pad) - 5.9rem - var(--pad-b));
  --row-w: min((100vw - var(--mx-l) - var(--mx-r) - var(--lamp-w) - var(--side-gap) - var(--cat-out)) / (1 - var(--keep-w)), 82rem, max(22rem, var(--wall-h) / 0.2773));
  --cat-over: calc(var(--cat-out) - var(--row-w) * var(--keep-w));
  --row-shift: calc((var(--lamp-w) + var(--side-gap) - var(--cat-over)) / 2 + (var(--mx-l) - var(--mx-r)) / 2);
  --lamp-a: 50%; --lamp-aq: 50cqw;
  --lamp-dx: calc(var(--row-shift) - var(--row-w) / 2 - var(--side-gap) - var(--lamp-w) / 2);
  --lamp-x: calc(var(--lamp-a) + var(--lamp-dx));
  --pet-a: 50%;
  --pet-dx: calc(var(--row-shift) + var(--row-w) / 2 + var(--cat-over) - var(--rug-r));
  /* the middle of the shade above the foot of the screen: the centre of the evening light */
  --glow-y: calc(var(--floor-h) + var(--lamp-lb) * 0.7154);
  --line: 27.731%;
  /* day */
  --room-ink: #141414; --room-ink-2: #47443f;      /* = --ink, --ink-2 by day (literals: the room fades them itself) */
  --floor-ink: #1d1813;
  --name-a: #141414; --name-b: #141414;
  /* by day the letters are near black, so a soft shadow only blurs their edge: none at all
     (two transparent shadows, so the filter can still fade to the evening one) */
  --name-shadow: drop-shadow(0.004em 0.006em 0 rgb(56 40 20 / 0)) drop-shadow(0.012em 0.016em 0.01em rgb(56 40 20 / 0));
  --sh: 45 34 20; --sa: 0.3; --sb: 2.6rem;
  --wire: rgb(74 64 52 / 0.72);
  overflow: clip;
  position: relative; isolation: isolate; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding: var(--pad-t) var(--edge) calc(var(--floor-h) + var(--pad-b));
  color: var(--room-ink);
  transition: color var(--room-t) var(--room-ease);
}
html[data-room="evening"] .hero2 {
  --room-ink: #f3ecdf; --room-ink-2: #d8cebd;
  --floor-ink: #f1e6d4;
  --name-a: #fbf2e1; --name-b: #cfc5b3;
  --name-shadow: drop-shadow(0.006em -0.002em 0.004em rgb(8 5 2 / 0.55)) drop-shadow(0.026em -0.007em 0.02em rgb(8 5 2 / 0.45));
  --sh: 8 5 2; --sa: 0.6; --sb: 3.1rem;
  --wire: rgb(196 174 140 / 0.5);
  --focus: #ff9a5c;
}

.wall, .wall__light, .wall__night, .wall__grain { position: absolute; inset: 0; }
/* (.wall is a size container, so the floor can place the pool of light with cqw) */
.wall { z-index: -1; pointer-events: none; container-type: size; background: linear-gradient(98deg, rgb(58 48 36 / 0) 26%, rgb(58 48 36 / 0.1) 100%); }
/* day: the lamp is off. Plain daylight from the upper left, neutral in colour, and not centred on the lamp */
.wall__light {
  background:
    /* the wall is a little shaded where it meets the skirting */
    linear-gradient(to top, rgb(52 42 30 / 0.1) 0, rgb(52 42 30 / 0) 100%) 0 calc(100% - var(--floor-h)) / 100% 5rem no-repeat,
    radial-gradient(ellipse 88vw 105svh at 16% -12%, rgb(255 255 253 / 0.6) 0%, rgb(255 255 253 / 0.3) 42%, rgb(255 255 253 / 0) 100%);
}
/* evening: the same room with only the lamp on. One layer that fades in over the day wall: a deep
   warm wall, the glow through the shade, the light the open shade throws up and down the wall,
   and a wide pool that falls off with distance. (The floor has its own evening images.) */
.wall__night {
  opacity: 0; transition: opacity var(--room-t) var(--room-ease);
  background:
    radial-gradient(ellipse calc(var(--lb) * 0.3) calc(var(--lb) * 0.26) at var(--lamp-x) calc(100% - var(--glow-y)),
      rgb(255 226 178 / 0.3) 0%, rgb(255 226 178 / 0.2) 38%, rgb(255 226 178 / 0.07) 72%, rgb(255 226 178 / 0) 100%),
    radial-gradient(ellipse calc(var(--lb) * 0.44) calc(var(--lb) * 0.56) at var(--lamp-x) calc(100% - var(--glow-y) - var(--lb) * 0.3),
      rgb(255 214 156 / 0.25) 0%, rgb(255 214 156 / 0.16) 35%, rgb(255 214 156 / 0.06) 70%, rgb(255 214 156 / 0) 100%),
    radial-gradient(ellipse calc(var(--lb) * 0.52) calc(var(--lb) * 0.6) at var(--lamp-x) calc(100% - var(--glow-y) + var(--lb) * 0.42),
      rgb(255 208 148 / 0.24) 0%, rgb(255 208 148 / 0.15) 38%, rgb(255 208 148 / 0.05) 72%, rgb(255 208 148 / 0) 100%),
    radial-gradient(circle clamp(36rem, 96vw, 112rem) at var(--lamp-x) calc(100% - var(--glow-y)),
      rgb(255 198 132 / 0.42) 0%, rgb(255 198 132 / 0.34) 7%, rgb(255 198 132 / 0.265) 15%, rgb(255 198 132 / 0.195) 25%,
      rgb(255 198 132 / 0.13) 37%, rgb(255 198 132 / 0.08) 51%, rgb(255 198 132 / 0.042) 66%, rgb(255 198 132 / 0.016) 82%, rgb(255 198 132 / 0) 100%),
    /* the wall where the lamp hardly reaches: dark, but not so dark that the far frames look spot-lit;
       a touch lighter towards the pale skirting */
    linear-gradient(to bottom, #302b26 0%, #322d27 55%, #3b342d calc(100% - var(--floor-h)), #3b342d 100%);
}
html[data-room="evening"] .wall__night { opacity: 1; }
/* a fine grain over the wall: plaster, and it keeps the long gradients from banding */
.wall__grain {
  bottom: var(--floor-h);
  opacity: 0.3; mix-blend-mode: soft-light;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 240px 240px;
}

/* The floor: the top of a rendered strip (4000 x 700: skirting, then boards running away from the
   wall). Its vanishing point is the middle of the image, so it is centred on the window and
   cropped, never stretched. 541.7 image px per metre at the line the lamp stands on, the lamp
   image has 1400: so the strip is shown 4.3083 lamp boxes wide. */
.floor { position: absolute; left: 0; right: 0; bottom: 0; height: var(--floor-h); overflow: hidden; background: #b9a388; }
.floor picture { display: contents; }
.floor__img { position: absolute; left: 50%; top: 0; width: max(100%, var(--lb) * 4.3083); max-width: none; height: auto; transform: translateX(-50%); }
.floor__img--eve { opacity: 0; transition: opacity var(--room-t) var(--room-ease); }
html[data-room="evening"] .floor__img--eve { opacity: 1; }
/* (the lit boards only ever show inside the pool, so that picture is the left 2300 x 434 of the strip) */
.floor__lit .floor__img { --fw: max(100%, var(--lb) * 4.3083); left: calc(50% - var(--fw) / 2); width: calc(var(--fw) * 0.575); transform: none; }
/* the boards as the lamp lights them, shown inside the lamp's real footprint of light: a mask
   (800 x 197, drawn two lamp boxes wide) whose foot point (50%, 27.86%) sits on the lamp's foot */
.floor__lit {
  --pool-x: calc(var(--lamp-aq) + var(--lamp-dx) - var(--lb)); --pool-y: calc(var(--lb) * -0.0374);
  --pool-w: calc(var(--lb) * 2); --pool-h: calc(var(--lb) * 0.4917);
  --pool-fade: linear-gradient(90deg, transparent 0%, #000 26%, #000 74%, transparent 100%);
  position: absolute; inset: 0; opacity: 0; transition: opacity var(--room-t) var(--room-ease);
  /* (the footprint still has some light at its left and right ends: a second mask fades those out) */
  -webkit-mask-image: url("../img/room/pool-evening.webp"), var(--pool-fade);
  mask-image: url("../img/room/pool-evening.webp"), var(--pool-fade);
  -webkit-mask-position: var(--pool-x) var(--pool-y); mask-position: var(--pool-x) var(--pool-y);
  -webkit-mask-size: var(--pool-w) var(--pool-h); mask-size: var(--pool-w) var(--pool-h);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
html[data-room="evening"] .floor__lit { opacity: 1; }
/* the room ends on the front edge of its boards (see .kinetic::before for the step down to the page) */
.floor::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgb(30 22 12 / 0.28); }

/* The lamp: a rendered floor lamp (linen drum shade, thin black stem, brass collar) standing on
   the floor. It is a button: its box is the lamp itself, from the top of the shade to the front
   of the base, as wide as the shade. The images are larger (900 x 2400 with the shadow on the
   floor) and hang out of the box; .lamp__art is that image box. */
.lamp {
  --lb: var(--lamp-lb);
  position: absolute; z-index: 2; left: var(--lamp-x); bottom: calc(var(--floor-h) - var(--lb) * 0.1156);
  width: var(--lamp-w); height: calc(var(--lb) * 0.907); transform: translateX(-50%);
  appearance: none; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--floor-ink);
  border-radius: 0.5rem; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: color var(--room-t) var(--room-ease);
}
.lamp:disabled { cursor: default; }
.lamp:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; border-radius: 0.5rem; }
.lamp__art { position: absolute; left: 50%; top: calc(var(--lb) * -0.055); width: calc(var(--lb) * 0.375); height: var(--lb); transform: translateX(-50%); pointer-events: none; }
.lamp__art picture { display: contents; }
.lamp__img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; }
/* lit: the same lamp with the light on, laid over the unlit one (their outlines are the same) */
.lamp__img--on { opacity: 0; transition: opacity var(--room-t) var(--room-ease); }
html[data-room="evening"] .lamp__img--on { opacity: 1; }
/* by day: its soft shadow on the wall, thrown to the right by the window light (the render only
   has the shadow on the floor). A blurred silhouette of the lamp, cut off where the wall ends. */
.lamp__shadow {
  position: absolute; inset: 0; opacity: 0.13; transform: translate(calc(var(--lb) * 0.075), calc(var(--lb) * 0.014));
  background: url("../img/room/lamp-off-sm.webp") 0 0 / 100% 100% no-repeat;
  filter: brightness(0) blur(calc(var(--lb) * 0.018));
  clip-path: inset(-10% -40% 9.5% -40%);
  transition: opacity var(--room-t) var(--room-ease);
}
html[data-room="evening"] .lamp__shadow { opacity: 0; }
/* the pull cord is its own small image over the lamp, so it can give when the lamp is pressed.
   v9.2: it comes from the socket inside the shade; the render cut it out where the shade's front
   wall is in front of it, so the image starts exactly at the lip (4.55% down its box, 492 of the
   lamp canvas) and passes in front of the shade's underside. The cord in the box: 508..548 x 478..786. */
.lamp__cord { position: absolute; left: 56.444%; top: 19.917%; width: 4.444%; height: 12.833%; transform-origin: 50% 4.55%; transition: transform 0.2s var(--ease); }
.lamp__cord-img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; }
.lamp__cord-img--on { opacity: 0; transition: opacity var(--room-t) var(--room-ease); }
html[data-room="evening"] .lamp__cord-img--on { opacity: 1; }
/* the tug: the cord slides out of the shade, so its top stays at the lip and the pull goes down
   11.5 canvas px (as before): a stretch from the lip, 282 px to the foot of the pull */
.lamp:not(:disabled):active .lamp__cord, .lamp.is-pulled .lamp__cord { transform: scaleY(1.041); transition-duration: 0.08s; }
/* bloom round the lit shade (its middle is 0.076 of the box below the top of the button). It lies
   over whatever is near, like bloom in a photograph. Out by day. */
.lamp__glow {
  position: absolute; left: 50%; top: calc(var(--lb) * 0.076); width: calc(var(--lb) * 0.86); aspect-ratio: 1 / 1; transform: translate(-50%, -50%); pointer-events: none;
  opacity: 0; transition: opacity var(--room-t) var(--room-ease);
  background: radial-gradient(closest-side, rgb(255 228 176 / 0.34) 0%, rgb(255 220 160 / 0.2) 24%, rgb(255 210 144 / 0.09) 50%, rgb(255 204 136 / 0.025) 76%, rgb(255 204 136 / 0) 100%);
}
html[data-room="evening"] .lamp__glow { opacity: 1; }
/* a hint that it can be switched on: the shade warms a little under the pointer, and once, by
   itself, after the intro (.is-nudge, set by initLamp) */
@media (hover: hover) { html:not([data-room="evening"]) .lamp:not(:disabled):hover .lamp__img--on { opacity: 0.4; transition-duration: 0.3s; } }
html:not([data-room="evening"]) .lamp.is-nudge .lamp__img--on { opacity: 0.7; transition-duration: 0.4s; }
html:not([data-room="evening"]) .lamp.is-nudge .lamp__glow { opacity: 0.5; transition-duration: 0.4s; }
/* intro: if the visitor left the room in evening light, the lamp comes on */
html.intro-pending[data-room="evening"] .lamp__glow { opacity: 0.2; transition: none; }
/* the hint: a small switch and two words on the floor beside the foot of the lamp */
.lamp__hint {
  position: absolute; left: calc(100% - var(--lb) * 0.012); bottom: calc(var(--lb) * 0.016 - 0.75rem); height: 1.5rem; padding-left: 0.5rem;
  display: flex; align-items: center; gap: 0.45rem; white-space: nowrap;
  font-size: var(--text-micro); font-weight: var(--w-mid); line-height: 1;
}
/* in the evening the hint lies in the pool of light, on bright boards: it stays dark */
html[data-room="evening"] .lamp { color: #23180b; }
.lamp:disabled .lamp__hint { display: none; }
.lamp__switch {
  position: relative; flex: none; width: 1.3rem; height: 0.75rem; border-radius: 1rem;
  box-shadow: inset 0 0 0 1px currentColor; background-color: rgb(255 255 255 / 0.28);
  transition: background-color var(--room-t) var(--room-ease), box-shadow var(--room-t) var(--room-ease);
}
.lamp__switch::after {
  content: ""; position: absolute; left: 0.17rem; top: 50%; width: 0.41rem; height: 0.41rem; margin-top: -0.205rem; border-radius: 50%;
  background: currentColor; transition: transform 0.35s var(--ease), background-color var(--room-t) var(--room-ease);
}
html[data-room="evening"] .lamp__switch { background-color: #23180b; box-shadow: inset 0 0 0 1px #23180b; }
html[data-room="evening"] .lamp__switch::after { transform: translateX(0.55rem); background-color: #ffd595; }

/* The cat, asleep on a floor cushion, on a small round rug. .pet is a point on the floor: the
   middle of the cushion's base, 0.4 m nearer than the lamp (so everything is drawn 1.071 times the
   lamp's scale and stands on row 135.7 of the floor image). The images hang round that point by
   their own contact points. Decoration: no focus, no clicks, except .pet__hit over the cat. */
.pet {
  position: absolute; z-index: 1; left: calc(var(--pet-a) + var(--pet-dx)); bottom: calc(var(--floor-h) - var(--lb) * 0.1462);
  width: 0; height: 0; pointer-events: none;
}
.pet picture { display: contents; }
.pet__rug { position: absolute; left: calc(var(--rw) * -0.472); top: calc(var(--rw) * 0.23 * -0.5365); width: var(--rw); height: auto; max-width: none; }
.pet__body { position: absolute; left: calc(var(--pw) * -0.3749); top: calc(var(--pw) * 0.75 * -0.7333); width: var(--pw); height: calc(var(--pw) * 0.75); }
.pet__img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; }
/* v10.1: the same pictures twice, cut along the top of the cushion (row 545 of the 1200-row canvas).
   .pet__still is the cushion, the cat's paws and tail where they lie on it, and the floor shadow: it never
   moves. .pet__breath is the cat above that line: the only part that breathes. Its transform-origin is on
   the cut, so the two halves always meet. --pet-seam-ov lets the still half reach a hair above the cut,
   under the breathing half, so no light line can open between them at a fractional pixel. */
.pet__still, .pet__breath { position: absolute; inset: 0; }
.pet__still { clip-path: inset(calc(45.4167% - var(--pet-seam-ov, 1px)) 0 0 0); }
.pet__breath { clip-path: inset(0 0 54.5833% 0); transform-origin: 37.49% 45.4167%; will-change: transform; }
/* day and evening versions change places: the one arriving comes quickly, the one leaving goes
   late, so the cat is never half transparent in between (their shadows differ, so both must fade) */
.pet__day { opacity: 1; transition: opacity var(--room-t) cubic-bezier(0.1, 0.7, 0.4, 1); }
.pet__eve { opacity: 0; transition: opacity var(--room-t) cubic-bezier(0.7, 0, 0.95, 0.5); }
html[data-room="evening"] .pet__day { opacity: 0; transition-timing-function: cubic-bezier(0.7, 0, 0.95, 0.5); }
html[data-room="evening"] .pet__eve { opacity: 1; transition-timing-function: cubic-bezier(0.1, 0.7, 0.4, 1); }
/* one eye open: a layer that holds only the open eye (alpha 0 everywhere else, same canvas as the
   sleeping cat), laid over it for a moment. Nothing else changes on hover or tap: no shadow, no
   cushion, no light, no filter, no transform (v10) */
/* will-change keeps the eye layers on their own compositor layer all the time, so fading one in or out
   never makes the browser re-raster the cat or the wall round it (that re-raster moved pixels by 1 to 3
   levels over the whole cat box, the shadow included) */
.pet__peek { opacity: 0; transition: opacity 0.14s linear; will-change: opacity; }
html:not([data-room="evening"]) .pet.is-peek .pet__peek--day, html[data-room="evening"] .pet.is-peek .pet__peek--eve { opacity: 1; }
/* the cushion's shadow on the skirting and the foot of the wall behind it (the render has the floor only) */
.pet__shade {
  position: absolute; left: calc(var(--pw) * -0.2); bottom: calc(var(--lb) * 0.085); width: calc(var(--pw) * 0.62); height: calc(var(--pw) * 0.2);
  background: radial-gradient(closest-side, rgb(42 32 20 / 0.22) 0%, rgb(42 32 20 / 0.1) 55%, rgb(42 32 20 / 0) 100%);
}
.pet__shade::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transform: translateX(22%) scale(1.25, 1.1);
  background: radial-gradient(closest-side, rgb(8 5 2 / 0.42) 0%, rgb(8 5 2 / 0.2) 55%, rgb(8 5 2 / 0) 100%);
  transition: opacity var(--room-t) var(--room-ease);
}
html[data-room="evening"] .pet__shade::after { opacity: 1; }
.pet__hit { position: absolute; left: calc(var(--pw) * -0.215); bottom: calc(var(--pw) * -0.02); width: calc(var(--pw) * 0.44); height: calc(var(--pw) * 0.39); border-radius: 45% 45% 30% 30%; pointer-events: auto; }
/* asleep, it breathes: a very small swell from the cushion up. It keeps breathing while it peeks
   (the eye layer is inside .pet__breath, so it moves with it); pausing it froze the picture at
   whatever phase the pointer arrived (v10). v10.1: only the cat above the cushion breathes, and only
   upward (no sideways swell, which would shear the cut): the cushion, its outline and the floor
   shadow never move. */
@keyframes pet-breathe { 0%, 100% { transform: scale(1, 1); } 46% { transform: scale(1, 1.016); } }
@media (prefers-reduced-motion: no-preference) {
  .pet__breath { animation: pet-breathe 4.2s ease-in-out infinite; }
}

/* The name is part of the wall: letters that stand a hair proud of it, so the lamp gives them a
   short soft shadow on the far side. In the evening they are pale and take the light: brighter
   near the lamp, dimmer away from it (--name-a to --name-b). */
.name {
  display: flex; align-items: center; justify-content: center; gap: 0.2em;
  font-family: var(--font-sans); font-weight: var(--w-bold);
  font-size: var(--name-fs); line-height: 0.8; letter-spacing: var(--track-display);
  white-space: nowrap;
  filter: var(--name-shadow);
  transition: --name-a var(--room-t) var(--room-ease), --name-b var(--room-t) var(--room-ease), filter var(--room-t) var(--room-ease);
}
.name__word {
  display: block; padding: 0.14em 0.05em 0.24em; margin: -0.14em -0.05em -0.24em;      /* room for the descender, so the fill is not cut off */
  color: var(--name-a);
  background: linear-gradient(var(--name-angle, 90deg), var(--name-a) 0%, var(--name-b) 100%) var(--name-x, 0) 0 / var(--name-w, 100%) 100% no-repeat;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
/* one gradient across both words: the first word takes its left part, the second its right */
.name__word:nth-child(1) { --name-w: 152%; --name-x: 0%; }
.name__word:nth-child(2) { --name-w: 330%; --name-x: 100%; }
@media (forced-colors: active) { .name__word { background: none; -webkit-text-fill-color: currentColor; color: CanvasText; } .name { filter: none; } }

/* the "y" of the first name hangs about 0.2em below its line: the intro line always clears it */
.hero2__lede {
  margin-top: var(--lede-m);
  max-width: 35.5rem; text-align: center; text-wrap: balance;
  font-size: var(--text-lede); font-weight: var(--w-text); line-height: 1.38; letter-spacing: -0.005em;
}

/* a small line at the foot of the boards, in the middle of the room: clear of the lamp and of the rug */
.hero2__open {
  position: absolute; z-index: 1; left: 50%; transform: translateX(-50%); bottom: clamp(0.55rem, 1.5svh, 0.95rem);
  display: flex; align-items: center; gap: 0.5rem; white-space: nowrap;
  font-size: var(--text-micro); font-weight: var(--w-mid); line-height: 1.2; color: var(--floor-ink);
  transition: color var(--room-t) var(--room-ease);
}
.hero2__dot { flex: none; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--signal); }
html[data-room="evening"] .hero2__dot { background: #ff7a3d; }

/* The gallery: four frames in a row, hanging level, each its own size, with equal gaps between
   them. Their bottom edges sit on one line, so the four labels under them share one line too,
   the way a gallery hangs a row. The row is never taller than the first screen allows. */
.gallery {
  position: relative; left: var(--row-shift);
  width: var(--row-w);
  /* centred in whatever wall is left between the text and the floor */
  margin-block: auto; padding-top: var(--gal-pad);
  scroll-margin-top: 4rem;
}
.gallery__row { display: flex; justify-content: space-between; align-items: flex-start; }
/* --w: width of the frame in % of the row. --tall: height of wire plus frame as a share of that
   width (1.12, plus 0.14 of the mat, which is deeper at the foot). A frame hangs so far down that
   its bottom edge lands on --line: the tallest one (PillPal, 24.5% x 1.1319) starts at the top. */
.hang { flex: none; width: var(--w); margin-top: calc(var(--line) - var(--w) * var(--tall)); container-type: inline-size; --lit: 1; }
.hang--yantra { --w: 23.5%; --tall: 1.1291; --sx: 0.8rem; --sy: 1.7rem; }
.hang--navibus { --w: 20.5%; --tall: 1.1284; --sx: 1.1rem; --sy: 1.7rem; }
.hang--pillpal { --w: 24.5%; --tall: 1.1319; --sx: 1.3rem; --sy: 1.6rem; }
.hang--keep { --w: 21.5%; --tall: 1.1287; --sx: 1.5rem; --sy: 1.5rem; }
/* evening: the lamp is the only light. Shadows run longer and flatter the further a frame is from
   it, and much less light arrives: the wall falls off about five times from the lamp to the far side. */
html[data-room="evening"] .hang--yantra { --lit: 0.97; --sx: 1.5rem; --sy: 1.3rem; }
html[data-room="evening"] .hang--navibus { --lit: 0.86; --sx: 2.3rem; --sy: 0.9rem; }
html[data-room="evening"] .hang--pillpal { --lit: 0.74; --sx: 2.9rem; --sy: 0.9rem; }
html[data-room="evening"] .hang--keep { --lit: 0.64; --sx: 3.4rem; --sy: 0.6rem; }

.hang__link { position: relative; display: block; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.hang__link:focus-visible { outline-offset: 8px; }
/* the part that swings: wire and frame turn about the nail (the top of the wire) */
.hang__swing { position: relative; z-index: 1; display: block; transform-origin: 50% 0.45cqi; pointer-events: none; }
.hang__swing.is-swinging { will-change: transform; }
.hang__wire { display: block; width: 100%; height: 12cqi; margin-bottom: -1px; overflow: visible; }
.hang__wire path { fill: none; stroke: var(--wire); stroke-width: 1.1px; stroke-linecap: round; stroke-linejoin: round; transition: stroke var(--room-t) var(--room-ease); }
.hang__nail {
  position: absolute; z-index: 2; left: 50%; top: 0.45cqi; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #e4e0d7 0%, #8a857b 52%, #3d3a35 100%);
  box-shadow: 1px 1.5px 1.5px rgb(40 30 20 / 0.4);
}

/* A frame: the moulding is a border (so its corners are mitred, lit from the upper left), then a
   mat, then the picture. Thicknesses are in cqi, so a frame keeps its proportions at any size. */
.frame {
  --m: 2.9cqi; --mat: 6.5cqi; --mat-c: #f6f3ec; --edge-a: 0.12;
  --f-t: #33312e; --f-r: #0e0d0d; --f-b: #181716; --f-l: #2a2826;
  position: relative; display: block; border-radius: 1px;
  border: var(--m) solid; border-color: var(--f-t) var(--f-r) var(--f-b) var(--f-l);
  /* the lip where the moulding meets the glass, then the shadow on the wall: a tight one where the
     frame touches, a soft one further out, both thrown away from the lamp */
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.22),
    0 0 0 0.5px rgb(40 30 20 / var(--edge-a)),
    calc(var(--sx) * 0.07) calc(var(--sy) * 0.07 + 1px) 2px rgb(var(--sh) / calc(var(--sa) * 0.68)),
    calc(var(--sx) * 0.38) calc(var(--sy) * 0.4 * var(--lift, 1)) 1rem -0.3rem rgb(var(--sh) / calc(var(--sa) * 0.88)),
    var(--sx) calc(var(--sy) * var(--lift, 1)) var(--sb) -0.8rem rgb(var(--sh) / var(--sa));
  transition: transform 0.3s var(--ease), box-shadow var(--room-t) var(--room-ease), border-color var(--room-t) var(--room-ease);
}
/* v9.1: the lamp's fall-off (--lit) darkens the moulding, the mat and the glass, which are drawn
   here. The picture is her work: it is never taken below --glare (0.92), so the names stay crisp.
   color-mix with black at --lit is exactly what brightness(--lit) did to these flat colours. */
html[data-room="evening"] .frame {
  --pic-lit: max(var(--lit), var(--glare));
  border-color:
    color-mix(in srgb, var(--f-t) calc(var(--lit) * 100%), #000) color-mix(in srgb, var(--f-r) calc(var(--lit) * 100%), #000)
    color-mix(in srgb, var(--f-b) calc(var(--lit) * 100%), #000) color-mix(in srgb, var(--f-l) calc(var(--lit) * 100%), #000);
}
html[data-room="evening"] .frame__mat { background-color: color-mix(in srgb, var(--mat-c) calc(var(--lit) * 100%), #000); }
html[data-room="evening"] .frame .frame__pic {
  filter: brightness(var(--pic-lit));
  /* the bevel is part of the mat: it ends up at --lit after the picture's own filter */
  box-shadow: 0 0 0 1px color-mix(in srgb, rgb(255 255 255 / 0.9) calc(var(--lit) / var(--pic-lit) * 100%), rgb(0 0 0 / 0.9)), 0 0 0 2px rgb(50 40 28 / 0.13);
}
html[data-room="evening"] .frame__glass { opacity: var(--lit); }
.frame__mat {
  position: relative; display: block; padding: var(--mat); padding-bottom: calc(var(--mat) * 1.14);
  background: var(--mat-c); transition: background-color var(--room-t) var(--room-ease);
  /* the moulding stands proud of the mat and shades its top and left edges */
  box-shadow: inset 0.22rem 0.2rem 0.3rem -0.08rem rgb(30 24 16 / 0.3), inset 0 0 0 1px rgb(30 24 16 / 0.06);
}
/* the picture: the same flat cover the dialog shows. The bevel of the mat is a pale line round it;
   the mat's thickness shades it from the upper left. */
.frame .frame__pic { border-radius: 0; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.9), 0 0 0 2px rgb(50 40 28 / 0.13); }
.frame .frame__pic::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  box-shadow: inset 0.14rem 0.14rem 0.22rem rgb(0 0 0 / 0.3), inset 0 0 0 1px rgb(0 0 0 / 0.08);
}
/* glass: a faint reflection of the lamp on the side nearest to it, warmer when the lamp is the only light */
.frame__glass {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(112deg, rgb(255 250 238 / 0.2) 0%, rgb(255 250 238 / 0.06) 20%, rgb(255 255 255 / 0) 38%, rgb(255 255 255 / 0) 78%, rgb(255 255 255 / 0.05) 100%);
}
.frame__glass::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity var(--room-t) var(--room-ease);
  background: linear-gradient(100deg, rgb(255 206 140 / 0.2) 0%, rgb(255 206 140 / 0.07) 16%, rgb(255 206 140 / 0) 36%);
}
html[data-room="evening"] .frame__glass::after { opacity: 1; }
.frame--oak { --m: 3.5cqi; --mat: 6cqi; --mat-c: #f8f6f0; --f-t: #d3b188; --f-r: #a8835a; --f-b: #b38d61; --f-l: #c9a67c; }
.frame--white { --m: 3.1cqi; --mat: 8.5cqi; --mat-c: #fbfaf6; --f-t: #fcfbf8; --f-r: #d5d1c9; --f-b: #dedad3; --f-l: #f3f1ec; --edge-a: 0.2; }
.frame--walnut { --m: 3.3cqi; --mat: 6.2cqi; --mat-c: #f5f1e8; --f-t: #6d4c38; --f-r: #3d291d; --f-b: #493123; --f-l: #5f4130; }

.hang__link:hover .cover__art--full img, .hang__link:focus-visible .cover__art--full img { transform: scale(1.04); }
/* The project's name is printed on the picture, small, bold and tight at the top-left (v6:
   .cover__title in styles.css, in the ink sampled for each cover). On the smallest frames it
   stops shrinking at about 9.5px. It dims with its frame in the evening and flies with the picture. */
.frame .cover__title { font-size: max(11.5cqi, 0.59rem); }

/* The wall label: a small card under each frame, the way a gallery labels a picture. It is part of
   the same link and it does not swing. In the evening it is still a white card, seen in lamplight.
   v9: the name is on the picture, so the label only says what the project is, then status and year. */
.placard {
  position: relative; display: grid; width: fit-content; max-width: min(100%, 10.75rem); margin-top: clamp(0.6rem, 1.5svh, 0.95rem); padding: 0.42em 0.72em 0.48em;
  background: #fbfaf7; color: #1b1917; border-radius: 1px; text-align: left;
  font-size: var(--placard-fs); line-height: 1.32; letter-spacing: 0;
  box-shadow: 0 0 0 0.5px rgb(40 30 20 / 0.16), calc(var(--sx) * 0.05) 1px 1.5px rgb(var(--sh) / 0.24), calc(var(--sx) * 0.14) 2px 5px -1px rgb(var(--sh) / 0.18);
  transition: box-shadow var(--room-t) var(--room-ease), filter var(--room-t) var(--room-ease), background-color var(--room-t) var(--room-ease);
}
/* a far label is dimmed a good deal, so its two greys go darker to stay readable (4.5:1 or better) */
html[data-room="evening"] .placard { --pl-2: #2b2825; --pl-3: #36322e; background: #efe4d0; filter: brightness(calc(var(--lit) * 0.95)); }
.placard__sep { white-space: pre; }
.placard__what { color: #1b1917; font-weight: var(--w-mid); text-wrap: balance; }
.placard__meta { color: var(--pl-3, #57534c); font-variant-numeric: tabular-nums; }

/* Without the script: a plain damped swing in CSS. With it, js/motion.js runs the pendulum. */
@keyframes hang-swing {
  0% { transform: rotate(0deg); }
  12% { transform: rotate(-4.4deg); }
  33% { transform: rotate(2.5deg); }
  54% { transform: rotate(-1.3deg); }
  74% { transform: rotate(0.6deg); }
  90% { transform: rotate(-0.2deg); }
  100% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: no-preference) {
  html:not(.js) .hang__link:hover .hang__swing, html:not(.js) .hang__link:focus-visible .hang__swing { animation: hang-swing 3s cubic-bezier(0.37, 0, 0.63, 1) both; }
}
/* Reduced motion: nothing swings and the light changes at once. The frame lifts a little and its shadow spreads. */
@media (prefers-reduced-motion: reduce) {
  .landing { --room-t: 0s; }
  .lamp__cord, .lamp__switch::after, .pet__peek { transition: none; }
  .hang__link:hover .frame, .hang__link:focus-visible .frame { transform: translateY(-4px); --lift: 1.35; }
  .hang__link:hover .cover__art--full img, .hang__link:focus-visible .cover__art--full img { transform: none; }
}

/* (The tiny header floats over the room. Its colours are the site's tokens, so it follows the light.) */

/* Tall windows (a tablet held upright): two frames to a row, so the wall is not left half empty.
   The lamp and the cat stand in the margins beside them. */
@media (min-width: 720px) and (max-aspect-ratio: 5 / 6) {
  .hero2 {
    --lb: clamp(15rem, min(34svh, 46vw), 30rem);
    --floor-h: clamp(8rem, 15svh, 12.5rem);
    --pet-k: 1.1;
    /* two rows of labels: the cat keeps to the margin right of the frames */
    --row-w: min(100vw - 2 * var(--mx) - var(--lamp-w) - var(--cat-w) - 2 * var(--side-gap), 36rem, max(20rem, (100svh - var(--floor-h) - 34.4rem) * 0.9));
    --row-shift: calc((var(--lamp-w) - var(--cat-w)) / 2);
    --pet-dx: min(var(--row-shift) + var(--row-w) / 2 + var(--side-gap) + var(--cat-l), 50vw - var(--rug-r) - 0.75rem);
  }
  .gallery__row { flex-wrap: wrap; row-gap: 1.25rem; }
  /* the two wide frames (47% x 1.129) set the line; each row of two shares it */
  .hero2 { --line: 53.07%; }
  .hang--yantra { --w: 47%; }
  .hang--navibus { --w: 43%; }
  .hang--pillpal { --w: 43%; }
  .hang--keep { --w: 47%; }
  html[data-room="evening"] .hang--yantra { --lit: 0.9; --sx: 1.4rem; --sy: -0.4rem; }
  html[data-room="evening"] .hang--navibus { --lit: 0.74; --sx: 2.4rem; --sy: -0.3rem; }
  html[data-room="evening"] .hang--pillpal { --lit: 0.95; --sx: 1.6rem; --sy: 0.5rem; }
  html[data-room="evening"] .hang--keep { --lit: 0.76; --sx: 2.6rem; --sy: 0.3rem; }
}
/* Phones: two frames to a row. A smaller lamp stands in the left margin beside the lower row, the
   cat lies in the right corner in front of the wall under the last label (the first screen keeps
   that much wall free above the skirting: --cat-rise). */
@media (max-width: 719px) {
  .hero2 {
    --name-fs: min(20.5vw, 6.4rem); --line: 52.69%;
    /* the floor clears the home indicator on phones that have one */
    --safe-b: env(safe-area-inset-bottom, 0px);
    --lb: clamp(8.5rem, 20svh, 11rem); --pet-k: 1.15;
    /* the lamp is drawn larger than the room's scale here, so its shade is about 44px wide */
    --lamp-k: 1.3;
    --floor-h: calc(5.25rem + var(--safe-b));
    --pad-t: clamp(3.75rem, 8svh, 4.5rem);
    padding-bottom: calc(var(--floor-h) + var(--cat-rise) + 0.3rem);
    --lamp-l: calc(var(--lamp-w) + var(--edge) * 0.3 + 0.3rem);       /* the margin the lamp needs */
    --lamp-a: 0%; --lamp-aq: 0cqw; --lamp-dx: calc(var(--edge) * 0.3 + var(--lamp-w) / 2);
    /* the whole rug stays inside the window */
    --pet-a: 100%; --pet-dx: calc(-0.5rem - var(--rug-r));
    /* the row keeps clear of the lamp's shade, and its width also follows the height of the
       window, so the whole wall fits one screen on short phones */
    --row-w: min(100vw - var(--lamp-l) - 0.9rem, 21rem, max(13rem, (100svh - 30rem) * 0.76));
    /* centred, unless the lamp needs more margin than that leaves: then the row steps to the right */
    --row-shift: max(0px, var(--lamp-l) - (100vw - var(--row-w)) / 2);
    --sb: 1.8rem;
    /* the light comes from low on the left: shadows fall up and to the right, the name is brightest at its foot */
    --name-angle: 20deg;
  }
  html[data-room="evening"] .hero2 { --name-shadow: drop-shadow(0.005em -0.005em 0.005em rgb(8 5 2 / 0.6)) drop-shadow(0.016em -0.026em 0.028em rgb(8 5 2 / 0.5)); }
  .wall__light {
    background:
      linear-gradient(to top, rgb(52 42 30 / 0.1) 0, rgb(52 42 30 / 0) 100%) 0 calc(100% - var(--floor-h)) / 100% 3rem no-repeat,
      radial-gradient(ellipse 150vw 80svh at 10% -10%, rgb(255 255 253 / 0.6) 0%, rgb(255 255 253 / 0.28) 45%, rgb(255 255 253 / 0) 100%);
  }
  .wall__night {
    background:
      radial-gradient(ellipse calc(var(--lb) * 0.34) calc(var(--lb) * 0.3) at var(--lamp-x) calc(100% - var(--glow-y)),
        rgb(255 226 178 / 0.34) 0%, rgb(255 226 178 / 0.2) 40%, rgb(255 226 178 / 0.06) 74%, rgb(255 226 178 / 0) 100%),
      radial-gradient(ellipse calc(var(--lb) * 0.5) calc(var(--lb) * 0.62) at var(--lamp-x) calc(100% - var(--glow-y) - var(--lb) * 0.32),
        rgb(255 214 156 / 0.24) 0%, rgb(255 214 156 / 0.14) 38%, rgb(255 214 156 / 0.05) 72%, rgb(255 214 156 / 0) 100%),
      radial-gradient(circle max(46rem, 105svh) at var(--lamp-x) calc(100% - var(--glow-y)),
        rgb(255 198 132 / 0.46) 0%, rgb(255 198 132 / 0.36) 8%, rgb(255 198 132 / 0.27) 17%, rgb(255 198 132 / 0.19) 28%,
        rgb(255 198 132 / 0.125) 41%, rgb(255 198 132 / 0.072) 56%, rgb(255 198 132 / 0.034) 73%, rgb(255 198 132 / 0.01) 88%, rgb(255 198 132 / 0) 100%),
      linear-gradient(to bottom, #302b26 0%, #322d27 55%, #3b342d calc(100% - var(--floor-h)), #3b342d 100%);
  }
  .floor__lit {
    -webkit-mask-image: url("../img/room/pool-evening-sm.webp"), var(--pool-fade);
    mask-image: url("../img/room/pool-evening-sm.webp"), var(--pool-fade);
  }
  .lamp:focus-visible { outline-offset: 2px; }
  /* the switch and its two words lie on the boards under the foot of the lamp */
  .lamp__hint { left: calc(var(--edge) * 0.1); bottom: auto; top: calc(100% + 0.2rem); height: 1.1rem; padding-left: 0; gap: 0.35rem; font-size: 0.68rem; }
  /* v9.1: here the words and the switch lie at the rim of the small pool of light, on half-lit
     boards where neither dark nor pale ink reaches 4.5:1. So the ink is cream and the boards
     under the words are shaded by a soft dark patch with no edge, like the shadow of the lamp's
     foot (measured: 6:1 or better at 375, 390 and 414 wide). */
  html[data-room="evening"] .lamp { color: #f3ecdf; }
  html[data-room="evening"] .lamp__hint { border-radius: 1rem; background-color: rgb(20 13 6 / 0.5); box-shadow: 0 0 0.45rem 0.4rem rgb(20 13 6 / 0.5); }
  html[data-room="evening"] .lamp__switch { background-color: rgb(20 13 6 / 0.4); box-shadow: inset 0 0 0 1px #f3ecdf; }
  .name { flex-direction: column; gap: 0.06em; }
  .name__word:nth-child(1), .name__word:nth-child(2) { --name-w: 100%; --name-x: 0%; }
  .hero2__lede { margin-top: 1.1rem; font-size: var(--text-base); max-width: 21.5rem; }
  .hero2__open { bottom: calc(var(--safe-b) + 0.4rem); }
  .gallery { margin-block: 0; padding-top: 0.7rem; }
  .gallery__row { flex-wrap: wrap; row-gap: 0.6rem; }
  .hang__wire { height: 10cqi; }
  /* the wire is shorter here (10cqi), so --tall is 1.10 plus the mat */
  .hang--yantra { --w: 47.5%; --tall: 1.1091; --sx: 0.5rem; --sy: 1.1rem; }
  .hang--navibus { --w: 44%; --tall: 1.1084; --sx: 0.7rem; --sy: 1.1rem; }
  .hang--pillpal { --w: 44%; --tall: 1.1119; --sx: 0.5rem; --sy: 1.1rem; }
  .hang--keep { --w: 47.5%; --tall: 1.1087; --sx: 0.7rem; --sy: 1.1rem; }
  /* the lamp is low on the left: the lower left frame is nearest, the upper right furthest */
  html[data-room="evening"] .hang--yantra { --lit: 0.8; --sx: 0.7rem; --sy: -1.5rem; }
  html[data-room="evening"] .hang--navibus { --lit: 0.7; --sx: 1.5rem; --sy: -1.3rem; }
  html[data-room="evening"] .hang--pillpal { --lit: 0.96; --sx: 0.8rem; --sy: -0.9rem; }
  html[data-room="evening"] .hang--keep { --lit: 0.85; --sx: 1.7rem; --sy: -0.6rem; }
  /* the label: what it is, then status and year on one line under it (the name is on the picture) */
  .placard { --placard-fs: 0.65625rem; width: 100%; margin-top: 0.4rem; padding: 0.36em 0.6em 0.42em; line-height: 1.26; }
}
/* Short phones (up to 800px tall): the whole wall, the lamp with its switch and the cat must fit
   the first screen. Smaller frames, a smaller intro line, and a one-line label under the picture
   (which carries the name): one word and the year. The word is the status for all four ("Proposed"
   on YANTRA, which must never read as shipped; "Personal" on Google Keep, v9.1). What each
   project is stays in the link's accessible name. */
@media (max-width: 719px) and (max-height: 800px) {
  .hero2 {
    --name-fs: min(19vw, 6rem); --pad-t: 3.4rem;
    --lb: 8.25rem; --pet-k: 1.1; --lamp-k: 1.45;
    --floor-h: calc(5.25rem + var(--safe-b));
    padding-bottom: calc(var(--floor-h) + var(--cat-rise) + 0.2rem);
    --row-w: min(100vw - var(--lamp-l) - 0.9rem, 21rem, max(12.25rem, (100svh - 20.5rem - 30vw) * 0.9));
  }
  .hero2__lede { margin-top: 0.8rem; font-size: var(--text-sm); }
  .hero2__open { bottom: calc(var(--safe-b) + 0.3rem); }
  .gallery { padding-top: 0.55rem; }
  .gallery__row { row-gap: 0.5rem; }
  .placard { margin-top: 0.35rem; padding-inline: 0.5em; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.5em; }
  .placard__meta { display: contents; }
  .placard__status { display: block; grid-column: 1; grid-row: 1; color: #1b1917; font-weight: var(--w-mid); }
  .placard__year { grid-column: 2; grid-row: 1; color: var(--pl-3, #57534c); }
  .placard__what, .placard__sep, .placard__long { display: none; }
  .frame .cover__title { font-size: max(11.5cqi, 0.66rem); }
}
/* Very short phones: the floor gives a little back, so the first screen stays close to one screen */
@media (max-width: 719px) and (max-height: 650px) {
  .hero2 { --floor-h: calc(4.4rem + var(--safe-b)); }
}
/* Short desktop windows (a 1366 x 657 laptop): a smaller name and a little less floor, so the
   frames and their labels keep a fair size on the first screen. */
@media (min-width: 720px) and (max-height: 720px) {
  .hero2 {
    --name-fs: min(var(--step-display), 16svh);
    --floor-h: max(5.75rem, 16svh);
    --pad-t: clamp(4rem, 10svh, 4.75rem);
    --gal-pad: clamp(0.7rem, 2.2svh, 1.1rem);
    --pad-b: 0.75rem;
  }
}
/* 2. Kinetic type band ------------------------------------------------------ */
/* Full bleed: no label, no side margins. At mid-scroll the longest row runs from one edge of the
   window to the other (it is 8.11em wide, so 12.1vw makes it 98vw). */
.kinetic { --kin-bg: var(--paper); position: relative; overflow: clip; padding-block: clamp(2.5rem, 8svh, 6rem) clamp(4rem, 13svh, 9rem); }
/* The join with the room above: the boards end on their cut front edge (a thin strip of end grain),
   and the floor throws a short soft shadow on the page below it, as a low step would. In the
   evening the page under the step is the same dim room, so the edge is darker and the shadow deeper. */
.kinetic::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3.25rem; pointer-events: none;
  background:
    linear-gradient(to bottom, var(--step-edge, #a48d70) 0, var(--step-edge-2, #8c7558) 5px, transparent 5px),
    linear-gradient(to bottom, color-mix(in srgb, var(--shadow) var(--step-a, 20%), transparent) 5px, color-mix(in srgb, var(--shadow) calc(var(--step-a, 20%) * 0.4), transparent) 1.1rem, transparent 100%);
}
html[data-room="evening"] .kinetic::before { --step-edge: #2a2019; --step-edge-2: #1b1410; --step-a: 55%; }
/* v9.1: the lamp's light carries on down the page, very faintly. The whole page keeps the fall-off
   of the wall above it: a touch warmer on the lamp's side (the left), dimmer towards the far side
   (the same from top to bottom, so no section shows an edge). On top of that a warm spill under
   the step here, one on the Experience stage and one behind the email; each fades out inside its
   own section. Evening only. The page is never more than about 12 levels lighter than --paper,
   and the far side is darker, so text contrast only goes up there (--ink-3 stays above 6:1). */
html[data-room="evening"] .landing {
  background-image: linear-gradient(to right, rgb(255 206 150 / 0.03) 0%, rgb(255 206 150 / 0) 38%, rgb(8 5 2 / 0) 46%, rgb(8 5 2 / 0.07) 74%, rgb(8 5 2 / 0.17) 100%);
}
html[data-room="evening"] .kinetic {
  background: radial-gradient(ellipse 62vw 82% at 13% 0%, rgb(255 206 150 / 0.085) 0%, rgb(255 206 150 / 0.055) 28%, rgb(255 206 150 / 0.024) 58%, rgb(255 206 150 / 0.006) 82%, rgb(255 206 150 / 0) 100%) no-repeat;
}
html[data-room="evening"] .xp__sticky {
  background: radial-gradient(ellipse 58% 52% at 4% 42%, rgb(255 206 150 / 0.05) 0%, rgb(255 206 150 / 0.032) 30%, rgb(255 206 150 / 0.013) 60%, rgb(255 206 150 / 0.003) 84%, rgb(255 206 150 / 0) 100%) no-repeat;
}
html[data-room="evening"] .closing__top {
  background: radial-gradient(ellipse 50% 50% at 50% 56%, rgb(255 206 150 / 0.055) 0%, rgb(255 206 150 / 0.035) 30%, rgb(255 206 150 / 0.014) 60%, rgb(255 206 150 / 0.003) 84%, rgb(255 206 150 / 0) 100%) no-repeat;
}
.kinetic__rows { display: grid; }
.kinetic__row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 0.16em;
  padding-inline: var(--edge);
  font-family: var(--font-sans); font-weight: var(--w-bold);
  font-size: clamp(2.6rem, 10.4vw, 12.5rem); line-height: 0.9; letter-spacing: var(--track-display);
}
/* the marks between the words: her design-tool marks, the one place the orange is used large */
.kinetic__row i { flex: none; display: inline-grid; width: 0.56em; height: 0.56em; margin: 0.06em 0.03em 0; letter-spacing: 0; }
.kinetic__row i svg { width: 100%; height: 100%; overflow: visible; }
/* a word and the mark after it are one unbreakable piece, so a mark never starts a line when the rows wrap */
.kinetic__w { display: inline-flex; align-items: center; gap: 0.16em; white-space: nowrap; }
/* wrapped (reduced motion or no script): a row does not end on a mark */
html:not(.motion) .kinetic__row > :last-child i { display: none; }
/* scroll-driven: one line per row, centred on the page; the script slides them from alternate
   sides so they line up centred when the band is mid-screen */
html.motion .kinetic__row {
  flex-wrap: nowrap; white-space: nowrap; width: max-content; justify-self: center; padding-inline: 0;
  font-size: 12.1vw;
  will-change: transform;
}
/* phones: one word to a line, so the sentence fills the screen instead of sitting in it as a
   small heading. The widest word ("complicated,", 5.43em) runs edge to edge. */
@media (max-width: 719px) {
  .kinetic { padding-block: clamp(3rem, 9svh, 5rem) clamp(4rem, 12svh, 7rem); }
  .kinetic__row { font-size: 16vw; }
  html.motion .kinetic__row { flex-direction: column; gap: 0; font-size: 17.3vw; line-height: 0.92; }
}

/* 3. Experience: a full-screen stage ----------------------------------------- */
.xp { position: relative; }
.xp__title { font-family: var(--font-sans); font-weight: var(--w-bold); font-size: clamp(1.75rem, 1.2rem + 1.5vw, 2.375rem); line-height: 0.98; letter-spacing: var(--track-head); text-wrap: balance; }
.xp__dl { margin-top: 1rem; border-top: 1px solid var(--rule); }
.xp__dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; padding-block: 0.42rem; border-bottom: 1px solid var(--rule); }
.xp__dl dt { flex: none; font-size: var(--text-micro); font-weight: var(--w-mid); color: var(--ink-3); }
.xp__dl dd { font-size: var(--text-xs); font-weight: var(--w-mid); line-height: 1.3; text-align: right; text-wrap: balance; }
.xp__role { font-weight: var(--w-bold); font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.4375rem); line-height: 1.05; letter-spacing: var(--track-head); }
.xp__text { margin-top: 0.5rem; font-size: var(--text-sm); line-height: 1.42; color: var(--ink-2); text-wrap: balance; }
.xp__text a { color: var(--ink); font-weight: 600; white-space: nowrap; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; margin-left: 0.35em; }
.xp__text a:hover { text-decoration-color: var(--signal); }

/* Without the script: a plain list of the four chapters, no stage */
.xp:not(.xp--live) { padding: var(--space-5) var(--edge); }
.xp:not(.xp--live) .xp__stage { display: none; }
.xp:not(.xp--live) .xp__panels { display: grid; gap: var(--space-4) calc(var(--gap) * 3); margin-top: var(--space-3); }
.xp:not(.xp--live) .xp__caption { margin-top: 1rem; }
.xp:not(.xp--live) .xp__meta { max-width: 20rem; }
@media (min-width: 900px) { .xp:not(.xp--live) .xp__panels { grid-template-columns: 1fr 1fr; } }

/* With the script: everything sits on one stage the size of the window */
.xp--live .xp__sticky { position: relative; height: 100svh; min-height: 33rem; overflow: clip; }
.xp--live .xp__label { position: absolute; z-index: 3; left: var(--edge); top: 1.4rem; }
.xp--live .xp__panel { position: absolute; inset: 0; z-index: 3; pointer-events: none; visibility: hidden; opacity: 0; transform: translateY(14px); }
.xp--live .xp__panel.is-active { visibility: visible; opacity: 1; transform: none; }
/* the fade and rise between chapters; the script adds .xp--anim once the first chapter is set */
.xp--anim .xp__panel { transition: opacity 0.18s ease-in, transform 0.18s ease-in, visibility 0s 0.18s; }
.xp--anim .xp__panel.is-active { transition: opacity 0.35s ease-out 0.16s, transform 0.35s var(--ease) 0.16s, visibility 0s 0.16s; }
/* small meta block, top-left */
.xp--live .xp__meta { position: absolute; left: var(--edge); top: 3.5rem; width: min(16.5rem, 60vw); }
/* small caption, bottom-centre, just above the control row */
.xp--live .xp__caption { position: absolute; left: 0; right: 0; bottom: 4.9rem; margin-inline: auto; width: min(29rem, 100% - 2 * var(--edge)); text-align: center; }
.xp--live .xp__panel.is-active a { pointer-events: auto; }
/* Her own control: four named steps across the foot of the stage, each under a hairline; the
   current one's line is drawn in ink. (Arrow keys, swipe, scroll and a tap on an object also
   change the step.) */
.xp__controls {
  position: absolute; z-index: 4; left: var(--edge); right: var(--edge); bottom: 0; height: 3.4rem;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(6px, 1vw, 14px);
}
.xp__tab {
  appearance: none; border: 0; background: none; cursor: pointer; position: relative;
  display: flex; align-items: baseline; gap: 0.7em; padding: 0.7rem 0 0; min-height: 2.75rem;
  color: var(--ink-3); text-align: left;
  font-family: var(--font-sans); font-size: var(--text-xs); font-weight: var(--w-mid); line-height: 1.2;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
  border-top: 1px solid var(--rule);
  transition: color 0.25s;
}
.xp__tab::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.5s var(--ease); }
.xp__tab[aria-current="true"]::before { transform: scaleX(1); }
.xp__tab:hover, .xp__tab[aria-current="true"] { color: var(--ink); }
.xp__tab-t { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 719px) { .xp__tab-t { display: none; } }

/* The stage (v6): one visual per chapter. Only the current chapter's visual is shown; it sits
   centred above its caption and lies flat when it rests. The script gives each .xp-card its own
   top and bottom (--xp-t, --xp-b) from that chapter's meta block and caption, so text and
   visual never overlap, and turns the card 5 degrees at most while chapters change. */
.xp__stage { position: absolute; inset: 0; z-index: 1; perspective: 1800px; perspective-origin: 50% 50%; touch-action: pan-y; }
.xp-card {
  position: absolute; left: var(--edge); right: var(--edge); top: var(--xp-t, 13rem); bottom: var(--xp-b, 13.5rem);
  display: flex; align-items: flex-end; justify-content: center;
  container-type: size;
  visibility: hidden; opacity: 0;
}
.xp-card.is-active { visibility: visible; opacity: 1; }
/* from 900px the meta block sits to the left of the visual, not above it (the script uses the
   same 900px to decide where the top of the visual goes). Up to 1099px the visual is centred in
   the room to the right of the meta block; from 1100px it is centred in the window. */
@media (min-width: 900px) {
  .xp-card { top: var(--xp-t, 3.5rem); left: calc(var(--edge) + 18rem); }
}
@media (min-width: 1100px) {
  .xp-card { right: calc(var(--edge) + 18rem); }
}
/* a few pixels of drift with the pointer; --mx and --my run from -0.5 to 0.5 */
.xp-obj { position: relative; flex: none; display: block; translate: calc(var(--mx, 0) * -10px) calc(var(--my, 0) * -6px); }
.xp-face { position: absolute; inset: 0; display: block; overflow: hidden; border-radius: inherit; }

/* 01: the whole Sales board in a plain browser frame, and one task card at a readable size
   over its bottom-right corner (the corner of the board is empty there) */
.xp-desk { width: min(100cqw, 100cqh / 0.846, 54rem); padding-bottom: calc(min(100cqw, 100cqh / 0.846, 54rem) * 0.07); }
.xp-browser { display: block; width: 92%; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgb(40 32 22 / 0.12), 0 0.3rem 0.7rem -0.2rem rgb(45 34 20 / 0.1), 0 1.8rem 3.2rem -1.6rem rgb(45 34 20 / 0.34); }
.xp-browser__bar { display: flex; align-items: center; gap: 1.1%; width: 100%; aspect-ratio: 92 / 3.4; padding-inline: 1.6%; background: #efede8; border-bottom: 1px solid rgb(40 32 22 / 0.1); }
.xp-browser__bar i { flex: none; width: 1.15%; aspect-ratio: 1; border-radius: 50%; background: #c9c5bc; }
.xp-browser__bar b { flex: none; width: 34%; height: 46%; margin-inline: auto; border-radius: 99px; background: #fbfaf8; box-shadow: inset 0 0 0 1px rgb(40 32 22 / 0.07); transform: translateX(-9%); }
/* the export is taller than its content: the empty strip under the board is left off, nothing is cut sideways */
.xp-browser img { display: block; width: 100%; height: auto; max-width: none; aspect-ratio: 2880 / 2320; object-fit: cover; object-position: 50% 0; }
/* Evening. Her screens keep their colours: they are only taken down a touch (--glare) so a white
   screen does not glare, and the things drawn round them (browser bar, sheets, bezels, the book)
   become warm dark objects with a pale hairline, so nothing is a white box with a hard edge. */
html[data-room="evening"] :is(.xp-browser img, .xp-detail, .xp-phone img, .laptop__lid img, .pd__card, .about2__photo img) { filter: brightness(var(--glare)); }
html[data-room="evening"] .xp-browser { background: #1d1a17; box-shadow: 0 0 0 1px rgb(255 236 210 / 0.13), 0 0.3rem 0.7rem -0.2rem rgb(8 5 2 / 0.4), 0 1.8rem 3.2rem -1.4rem rgb(8 5 2 / 0.8); }
html[data-room="evening"] .xp-browser__bar { background: #4a423b; border-bottom-color: rgb(0 0 0 / 0.35); }
html[data-room="evening"] .xp-browser__bar i { background: #71675c; }
html[data-room="evening"] .xp-browser__bar b { background: #37312c; box-shadow: inset 0 0 0 1px rgb(255 236 210 / 0.06); }
html[data-room="evening"] .xp-detail { box-shadow: 0 0 0 1px rgb(255 236 210 / 0.12), 0 0.3rem 0.7rem -0.2rem rgb(8 5 2 / 0.45), 0 1.5rem 2.6rem -0.9rem rgb(8 5 2 / 0.85); }
.xp-detail {
  position: absolute; right: 0; bottom: 0; width: min(38%, 284px); height: auto; max-width: none; border-radius: 10px;
  box-shadow: 0 0 0 1px rgb(40 32 22 / 0.1), 0 0.3rem 0.7rem -0.2rem rgb(45 34 20 / 0.14), 0 1.5rem 2.6rem -1rem rgb(45 34 20 / 0.42);
  translate: calc(var(--mx, 0) * -8px) calc(var(--my, 0) * -5px);
}

/* 02: a stack of sheets, each a little out of square with the next */
.xp-stack { width: min(100cqw - 1.5rem, (100cqh - 1.25rem) * 1.12, 33rem); aspect-ratio: 1.12; margin-bottom: 0.75rem; border-radius: 3px; }
.xp-stack i { position: absolute; inset: 0; border-radius: 3px; background: #f1efea; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.09), 0 0 0 0.5px rgb(0 0 0 / 0.12); }
.xp-stack i:nth-of-type(1) { transform: rotate(-3.2deg) translate(-2.5%, 2%); background: #d6d3cc; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.09), 0 1.6rem 3rem -1.4rem rgb(45 34 20 / 0.36); }
.xp-stack i:nth-of-type(2) { transform: rotate(2.6deg) translate(2%, 1%); background: #dcd9d2; }
.xp-stack i:nth-of-type(3) { transform: rotate(-1.4deg) translate(-1%, -1.5%); background: #e2dfd9; }
.xp-stack i:nth-of-type(4) { transform: rotate(1.9deg) translate(1.5%, 1%); background: #e8e5df; }
.xp-stack i:nth-of-type(5) { transform: rotate(-0.8deg) translate(-0.5%, 0.5%); background: #eeebe6; }
.xp-stack .xp-face { container-type: inline-size; background: #f8f7f3; display: grid; grid-template-rows: 1fr auto; align-items: end; padding: 7% 7.5% 6.5%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.07); }
.xp-stack__big { font-weight: var(--w-bold); font-size: 50cqi; line-height: 0.74; letter-spacing: -0.07em; align-self: center; }
.xp-stack__big sup { font-size: 0.42em; vertical-align: 0.9em; line-height: 0; color: var(--signal); letter-spacing: 0; margin-left: 0.04em; }
.xp-stack__foot { font-size: clamp(9px, 3.1cqi, 13.5px); font-weight: var(--w-mid); line-height: 1.3; color: var(--ink-2); max-width: 62%; }
/* evening: the sheets are warm dark card, each a shade deeper than the one above it */
html[data-room="evening"] .xp-stack i { background: #3d3630; box-shadow: inset 0 0 0 1px rgb(255 236 210 / 0.07), 0 0 0 0.5px rgb(0 0 0 / 0.4); }
html[data-room="evening"] .xp-stack i:nth-of-type(1) { background: #302a26; box-shadow: inset 0 0 0 1px rgb(255 236 210 / 0.06), 0 1.6rem 3rem -1.3rem rgb(8 5 2 / 0.85); }
html[data-room="evening"] .xp-stack i:nth-of-type(2) { background: #332d28; }
html[data-room="evening"] .xp-stack i:nth-of-type(3) { background: #37302b; }
html[data-room="evening"] .xp-stack i:nth-of-type(4) { background: #3a332e; }
html[data-room="evening"] .xp-stack i:nth-of-type(5) { background: #3e3731; }
html[data-room="evening"] .xp-stack .xp-face { background: #443c35; box-shadow: inset 0 0 0 1px rgb(255 236 210 / 0.1); }

/* 03: three phones in one thin-bezel frame: same size, same radius, same baseline, equal gaps.
   Only the outer two turn, 4 degrees, towards the middle one. */
.xp-phones { --pw: min(100cqw / 3.52, 100cqh * 0.462, 16.5rem); display: flex; align-items: flex-end; gap: calc(var(--pw) * 0.26); }
.xp-phone {
  flex: none; display: block; width: var(--pw); padding: calc(var(--pw) * 0.03); border-radius: calc(var(--pw) * 0.135);
  background: #18181b;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14), 0 0 0 0.5px rgb(0 0 0 / 0.5), 0 0.25rem 0.6rem -0.15rem rgb(45 34 20 / 0.14), 0 1.5rem 2.4rem -1.3rem rgb(45 34 20 / 0.36);
}
.xp-phone img { display: block; width: 100%; height: auto; max-width: none; aspect-ratio: 9 / 20; object-fit: cover; object-position: 50% 0; border-radius: calc(var(--pw) * 0.107); background: #fff; }
html[data-room="evening"] .xp-phone { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14), 0 0 0 1px rgb(255 236 210 / 0.2), 0 0.25rem 0.6rem -0.15rem rgb(8 5 2 / 0.45), 0 1.5rem 2.4rem -1.1rem rgb(8 5 2 / 0.85); }
html[data-room="evening"] .xp-phone img { background: #1d1a17; }
.xp-phone--a { transform: perspective(1600px) rotateY(4deg); }
.xp-phone--c { transform: perspective(1600px) rotateY(-4deg); }

/* 04: a book, seen from the front: the cover, and a sliver of the page block at its fore edge */
.xp-book { width: min(100cqw - 2rem, 100cqh * 0.667, 22rem); aspect-ratio: 2 / 3; border-radius: 2px 4px 4px 2px; box-shadow: 0 0.3rem 0.7rem -0.2rem rgb(45 34 20 / 0.16), 0 1.8rem 3rem -1.5rem rgb(45 34 20 / 0.42); }
.xp-book::before { content: ""; position: absolute; top: 1.1%; bottom: 1.1%; right: -1.7%; width: 6%; border-radius: 0 2px 2px 0; background: repeating-linear-gradient(to right, #f3eee1 0 1px, #d5cebc 1px 2px); box-shadow: 0 0 0 0.5px rgb(40 32 22 / 0.25); }
.xp-book .xp-face { container-type: inline-size; background: #24211e; color: #ece8df; display: grid; grid-template-rows: auto 1fr auto; padding: 9% 8% 9% 13%; }
.xp-book .xp-face::before { content: ""; position: absolute; left: 5.5%; top: 0; bottom: 0; width: 1px; background: rgb(255 255 255 / 0.13); box-shadow: -1px 0 0 rgb(0 0 0 / 0.5); }
.xp-book__title { align-self: center; font-weight: var(--w-bold); font-size: 12.6cqi; line-height: 0.95; letter-spacing: -0.045em; }
.xp-book__amp { color: #9c978c; }
.xp-book__small { font-size: clamp(8px, 3.7cqi, 12px); font-weight: var(--w-mid); letter-spacing: 0.02em; color: #a8a398; }
/* evening: a near-black book would sink into the page, so its cloth is a warm brown that the lamp can find */
html[data-room="evening"] .xp-book { box-shadow: 0 0 0 1px rgb(255 236 210 / 0.08), 0 0.3rem 0.7rem -0.2rem rgb(8 5 2 / 0.5), 0 1.8rem 3rem -1.3rem rgb(8 5 2 / 0.85); }
html[data-room="evening"] .xp-book::before { background: repeating-linear-gradient(to right, #cfc6b2 0 1px, #a79d8a 1px 2px); }
html[data-room="evening"] .xp-book .xp-face { background: #5a4435; color: #f3ecdf; }
html[data-room="evening"] .xp-book__amp { color: #cdbda6; }
html[data-room="evening"] .xp-book__small { color: #dccfba; }

@media (max-width: 899px) {
  .xp--live .xp__meta { top: 3.1rem; width: min(13.5rem, 58vw); }
  .xp--live .xp__caption { bottom: 4.4rem; }
  /* narrow: there is height to spare, so the task card is larger and hangs further below the frame */
  .xp-desk { width: min(100cqw, 100cqh / 0.976, 54rem); padding-bottom: calc(min(100cqw, 100cqh / 0.976, 54rem) * 0.2); }
  .xp-browser { border-radius: 6px; }
  .xp-detail { width: 54%; border-radius: 7px; }
  .xp-book { width: min(100cqw - 2rem, 100cqh * 0.667, 14.5rem); }
  /* narrow: the visual sits in the middle of the room between the meta block and the caption */
  .xp-card { align-items: center; }
  .xp-phones { --pw: min(100cqw / 3.44, 100cqh * 0.462, 16.5rem); gap: calc(var(--pw) * 0.22); }
}
/* phones: the three stay one size but overlap, the outer two partly behind the middle one,
   so each is wide enough to read */
@media (max-width: 719px) {
  .xp-phones { --pw: min(100cqw / 2.68, 100cqh * 0.462, 16.5rem); gap: 0; }
  .xp-phones .xp-phone--b { position: relative; z-index: 1; margin-inline: calc(var(--pw) * -0.16); }
}

/* Scroll-driven: the section is tall, the stage sticks for one screen while the chapters step */
html.motion .xp--live { height: calc(100svh + var(--xp-steps, 3) * 55svh); }
html.motion .xp--live .xp__sticky { position: sticky; top: 0; }

/* 4. Closing block ------------------------------------------------------------ */
/* One screen. The email is the whole upper part; the foot of the screen holds two quiet things
   side by side: who she is (a small photo and three lines) and the two things she takes on as
   freelance work, set as two bold lines. No labels over columns, no rules. */
.closing {
  min-height: 100svh; display: flex; flex-direction: column;
  padding: 0 var(--edge) 1.1rem;
  scroll-margin-top: 0;
}
.closing__top { flex: 1 0 auto; display: grid; justify-items: center; align-content: center; text-align: center; gap: 0; padding-block: clamp(5rem, 16svh, 10rem) clamp(3rem, 9svh, 6rem); }
.closing .contact__email { margin-top: 1.4rem; font-size: clamp(1.5rem, 7.4vw, 9.5rem); line-height: 0.9; white-space: nowrap; overflow-wrap: normal; }
.closing .contact__email span { display: inline; }
.closing__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem clamp(1.25rem, 3vw, 2.5rem); margin-top: clamp(1.5rem, 4svh, 2.5rem); font-size: var(--text-sm); font-weight: var(--w-mid); }
.closing__links a { text-decoration: none; padding-block: 0.5rem; background: linear-gradient(currentColor, currentColor) 0 calc(100% - 0.35rem) / 100% 1px no-repeat; transition: background-size 0.35s var(--ease); }
.closing__links a:hover { background-size: 0 1px; background-position: 100% calc(100% - 0.35rem); }
.closing__base { display: grid; gap: 2.5rem; }
.closing__col { scroll-margin-top: 2rem; }
.about2 { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1rem; align-items: start; max-width: 31rem; }
.about2__photo { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #5b6b4e; }
.about2__photo img { position: absolute; left: -14%; top: -12%; width: 128%; max-width: none; height: auto; }
.about2__quote { font-size: var(--text-sm); line-height: 1.48; color: var(--ink-2); text-wrap: pretty; }
/* the two services: a bold line each, with one small grey line after it */
.offer { display: grid; gap: 0.9rem; }
.offer__lead { font-size: var(--text-xs); font-weight: var(--w-mid); color: var(--ink-3); }
.offer__item { display: grid; gap: 0.2rem; }
.offer__h { font-size: clamp(1.1875rem, 1rem + 0.55vw, 1.5rem); font-weight: var(--w-bold); line-height: 1.02; letter-spacing: var(--track-head); text-wrap: balance; }
.offer__p { font-size: var(--text-sm); line-height: 1.42; color: var(--ink-2); max-width: 31rem; text-wrap: pretty; }
.closing__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem; margin-top: clamp(2.25rem, 6svh, 4rem); font-size: var(--text-micro); font-weight: var(--w-mid); color: var(--ink-3); }
.closing__foot a { text-decoration: none; }
.closing__foot a:hover { color: var(--ink); }
@media (min-width: 900px) {
  .closing__base { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(2rem, 6vw, 6rem); align-items: end; }
  .closing__base .offer { justify-self: end; width: min(100%, 33rem); }
}
/* phones: the email gets a whole screen to itself, on two lines, as wide as the window */
@media (max-width: 719px) {
  .closing__top { min-height: 92svh; padding-block: 4rem; }
  .closing .contact__email { font-size: 13.6vw; line-height: 0.88; }
  .closing .contact__email span { display: block; }
  .closing__links { margin-top: 1.75rem; }
  .offer__more { display: none; }
  .closing__base { gap: 2.75rem; }
}

/* 5. Project dialog ----------------------------------------------------------- */
.pd {
  /* 100%, not 100vw: with a classic scrollbar 100vw is wider than the window and clips the Close button */
  position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: hidden;
}
.pd[open] { display: grid; place-items: center; }
.pd::backdrop { background: transparent; }
.pd__scrim { position: absolute; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.pd__panel {
  --pd-h: min(92dvh, 51rem);
  position: relative; width: min(66rem, 100% - 2 * var(--edge)); max-height: var(--pd-h);
  overflow: auto; overscroll-behavior: contain;
  background: var(--raised); border-radius: 10px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.14), 0 22px 44px -14px rgb(0 0 0 / 0.38), 0 60px 130px -30px rgb(0 0 0 / 0.55);
}
html[data-room="evening"] .pd__panel { box-shadow: 0 0 0 1px rgb(255 236 210 / 0.07), 0 2px 6px rgb(0 0 0 / 0.3), 0 22px 44px -14px rgb(0 0 0 / 0.55), 0 60px 130px -30px rgb(0 0 0 / 0.7); }
.pd__bar {
  position: sticky; top: 0; z-index: 3; height: 3.25rem; margin-bottom: -3.25rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0 0.75rem 0 clamp(1.25rem, 2.6vw, 2.25rem);
  background: var(--raised);
}
.pd__bar-actions { display: flex; align-items: center; }
.pd__btn {
  appearance: none; cursor: pointer; border: 0; background: none; color: var(--ink);
  min-width: 2.5rem; min-height: 2.5rem; padding: 0 0.6rem; border-radius: 999px;
  font-family: var(--font-sans); font-size: var(--text-xs); font-weight: var(--w-mid); line-height: 1;
  transition: background-color 0.2s;
}
.pd__btn:hover { background: var(--hover); }
.pd__close { margin-left: 0.25rem; }
.pd__item { display: grid; }
.pd__item[hidden] { display: none; }
/* art well */
/* The illustration as a sleeve (where the flying cover lands) and, under it, one real screen
   from the project with a two-line caption, so visitors see the work itself before they open
   the case study. The well is a pale tint of a colour sampled from the illustration. */
.pd__art {
  --art-w: min(72%, 23rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.75rem;
  padding: 4.25rem 1.5rem 3rem;
  background: color-mix(in srgb, var(--well, #cfccc5) var(--well-mix, 16%), var(--well-base, #e6e3dc));
}
/* evening: the well is a darker, sunk part of the panel. No tint of the project's colour: mixed
   into a dark brown, the blue and the teal turn it slate, and the room has no cold greys. */
html[data-room="evening"] .pd__art { --well-mix: 0%; --well-base: #2c2723; }
.pd__item[data-project="yantra"] { --well: #1958d3; }
.pd__item[data-project="navibus"] { --well: #19b9c0; }
.pd__item[data-project="pillpal"] { --well: #c4699f; }
.pd__item[data-project="keep"] { --well: #e3b93c; }   /* the yellow of the notes, so it reads apart from PillPal */
.pd__art .sleeve { flex: none; width: var(--art-w); }
.pd__screen { flex: none; display: flex; align-items: flex-end; gap: 0.9rem; width: var(--art-w); margin: 0; }
.pd__screen img { flex: none; display: block; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px rgb(20 20 20 / 0.08), 0 8px 18px -8px rgb(20 20 20 / 0.35); }
.pd__screen--phone img { width: 30%; border-radius: 9px; }
.pd__screen--wide img { width: 62%; border-radius: 4px; }
.pd__screen figcaption { min-width: 0; padding-bottom: 0.15rem; font-size: var(--text-sm); font-weight: var(--w-mid); line-height: 1.3; color: var(--ink-2); text-wrap: balance; }
.pd__screen figcaption .label { display: block; margin-bottom: 0.2rem; }
/* v6, YANTRA only: a laptop drawn in CSS with the Sales board on it, and the Send to Quote Assist
   window over its bottom-right corner. Flat colours, one wide shadow under the laptop, no tilt.
   The display is 2880:1760, so the board is shown full width from the top and stops in the gap
   under the third row of cards (the export itself is 2880 x 2418, taller than any laptop). */
.pd__desk { flex: none; width: min(92%, 30rem); margin: 0; }
.pd__desk-stage { position: relative; padding-bottom: 24%; }
.laptop { position: relative; isolation: isolate; }
.laptop::after { content: ""; position: absolute; z-index: -1; left: 1%; right: 1%; bottom: -7%; height: 12%; border-radius: 50%; background: rgb(24 38 78 / 0.5); filter: blur(18px); }
.laptop__lid { margin: 0 5.5%; padding: 1.7% 1.7% 2%; border-radius: 3.2% 3.2% 0 0 / 5% 5% 0 0; background: #2e3035; box-shadow: 0 0 0 1px #8f9299; }
.laptop__lid img { display: block; width: 100%; height: auto; aspect-ratio: 2880 / 1760; object-fit: cover; object-position: 50% 0; border-radius: 1px; background: #fff; }
.laptop__base { position: relative; height: 0; padding-top: 3%; border-radius: 2px 2px 0.9rem 0.9rem / 2px 2px 0.55rem 0.55rem; background: #b9bcc3; box-shadow: inset 0 1px 0 #e4e6ea, inset 0 -1px 0 #8f9299; }
.laptop__base::before { content: ""; position: absolute; left: 42%; right: 42%; top: 0; height: 36%; border-radius: 0 0 0.3rem 0.3rem; background: #9a9da5; }
.pd__card { position: absolute; right: -6%; bottom: -4%; width: 46%; height: auto; border-radius: 4.6% / 7.2%; box-shadow: 0 0 0 1px rgb(24 38 78 / 0.08), 0 0.9rem 1.5rem -0.7rem rgb(24 38 78 / 0.42); }
/* evening: the laptop is the same drawing in a dim room (warm greys, no blue), on a dark shadow */
html[data-room="evening"] .laptop::after { background: rgb(8 5 2 / 0.75); }
html[data-room="evening"] .laptop__lid { background: #24211e; box-shadow: 0 0 0 1px #6f6961; }
html[data-room="evening"] .laptop__lid img { background: #1d1a17; }
html[data-room="evening"] .laptop__base { background: #8c877f; box-shadow: inset 0 1px 0 #b3ada3, inset 0 -1px 0 #5f5a54; }
html[data-room="evening"] .laptop__base::before { background: #726d66; }
html[data-room="evening"] .pd__card { box-shadow: 0 0 0 1px rgb(255 236 210 / 0.12), 0 0.9rem 1.5rem -0.6rem rgb(8 5 2 / 0.8); }
html[data-room="evening"] .pd__handset .xp-phone { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14), 0 0 0 1px rgb(255 236 210 / 0.2), 0 1.6rem 2.6rem -1.1rem rgb(8 5 2 / 0.85); }
.pd__desk figcaption { margin-top: 1.4rem; font-size: var(--text-sm); font-weight: var(--w-mid); line-height: 1.3; color: var(--ink-2); text-wrap: balance; }
.pd__desk figcaption .label { display: block; margin-bottom: 0.2rem; }
/* v6 review, the other three projects: one real screen in the phone frame of the Experience stage
   (.xp-phone, sized by --pw), centred, one wide soft shadow, the caption under it. No sleeve. */
.pd__handset { container-type: inline-size; flex: none; display: flex; flex-direction: column; align-items: center; width: 100%; margin: 0; }
.pd__handset .xp-phone { --pw: min(45cqw, 13.5rem, (var(--pd-h, 100dvh) - 13rem) / 2.15); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14), 0 0 0 0.5px rgb(0 0 0 / 0.5), 0 1.6rem 2.6rem -1.2rem rgb(30 28 40 / 0.4); }
.pd__handset figcaption { width: min(100%, 17rem); margin-top: 1.5rem; text-align: center; font-size: var(--text-sm); font-weight: var(--w-mid); line-height: 1.3; color: var(--ink-2); text-wrap: balance; }
.pd__handset figcaption .label { display: block; margin-bottom: 0.2rem; }
.pd__body { padding: 3.9rem clamp(1.25rem, 2.6vw, 2.25rem) clamp(1.5rem, 2.6vw, 2.25rem); }
.pd__title { font-family: var(--font-sans); font-weight: var(--w-bold); font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem); line-height: 0.92; letter-spacing: var(--track-display); }
.pd__client { margin-top: 0.8rem; }
.pd__desc { margin-top: 0.9rem; font-size: 1.0625rem; font-weight: var(--w-mid); line-height: 1.32; letter-spacing: -0.012em; max-width: var(--pd-measure); text-wrap: pretty; }
/* v6: the four facts are a 2x2 grid, a small uppercase label above each value */
.pd__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1.75rem; max-width: var(--pd-measure); margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.pd__meta > div { min-width: 0; }
.pd__meta dt { margin-bottom: 0.3rem; font-size: var(--text-micro); font-weight: var(--w-mid); line-height: 1.35; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.pd__meta dd { font-size: 0.9375rem; font-weight: var(--w-mid); line-height: 1.4; text-wrap: pretty; }
/* a neutral chip (YANTRA's status). No colour: it states a fact, it is not a warning. */
.pd__chip { display: inline-block; padding: 0.22rem 0.62rem; border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--ink) 5%, transparent); font-size: var(--text-sm); line-height: 1.3; white-space: nowrap; }
/* section labels: one style, darker than the meta keys, with clear space above. Body 16px / 1.6, about 60 characters a line. */
.pd__body { --pd-measure: 29.5rem; }
.pd__sections { display: grid; gap: 1.4rem; margin-top: 1.6rem; }
.pd__sections h3 { margin-bottom: 0.45rem; font-size: var(--text-micro); font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); }
.pd__sections p, .pd__sections li { font-size: 1rem; line-height: 1.6; color: var(--ink-2); max-width: var(--pd-measure); text-wrap: pretty; }
.pd__sections ul { display: grid; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.pd__sections li { position: relative; padding-left: 1.15rem; }
.pd__sections li::before { content: ""; position: absolute; left: 0.1rem; top: 0.72em; width: 0.32rem; height: 0.32rem; border-radius: 50%; background: var(--ink-3); }
/* the one status line, next to the button */
.pd__note { max-width: var(--pd-measure); margin-top: 1.4rem; font-size: var(--text-sm); line-height: 1.5; color: var(--ink-3); text-wrap: pretty; }
.pd__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 1rem; }
.pd__mins { font-size: var(--text-xs); color: var(--ink-3); }
@media (min-width: 760px) {
  .pd__bar { margin-left: 43%; }
  .pd__item { grid-template-columns: 43% minmax(0, 1fr); align-items: start; }
  .pd__art { --art-w: min(72%, 23rem, var(--pd-h) * 0.42); position: sticky; top: 0; height: var(--pd-h); padding: 2rem; border-radius: 10px 0 0 10px; }
  .pd__body { min-height: var(--pd-h); }
  /* a wide screen takes the sleeve's width less a margin; its caption goes under it */
  .pd__screen--wide { flex-direction: column; align-items: flex-start; gap: 0.7rem; }
  .pd__screen--wide img { width: 78%; box-shadow: none; }   /* this export carries its own soft edge */
}
@media (max-width: 759px) {
  .pd__panel { width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
  .pd__art { --art-w: min(60%, 46svh - 8rem, 17rem); min-height: 46svh; gap: 1.25rem; padding: 4.25rem 1.5rem 1.75rem; }
  /* the screen row may be wider than the sleeve so its caption keeps to two or three rows */
  .pd__screen { width: min(100%, 19rem); justify-content: center; }
  .pd__screen--phone img { width: 22%; }
  .pd__screen--wide img { width: 52%; }
  .pd__screen figcaption { flex: 0 1 auto; }
  .pd__art--desk { min-height: 0; padding: 4.5rem 1.5rem 1.75rem; }
  .pd__desk { width: min(80%, 22rem); }
  .pd__desk figcaption { margin-top: 1rem; }
  .pd__art--phone { min-height: 0; padding: 4.5rem 1.5rem 1.5rem; }
  .pd__handset .xp-phone { --pw: min(40cqw, 9rem); }
  .pd__handset figcaption { margin-top: 1rem; }
}
/* The cover in flight between the wall and the dialog: always a flat copy. Leaving the frame it
   is the picture itself (a plain .cover); coming back it is a copy of the dialog's sleeve, drawn
   flat like the settled one, so it lands exactly on the picture inside the frame. */
.pd-fly { will-change: transform; }
.pd-fly:not(.sleeve) { box-shadow: 0 1.1rem 2.2rem -0.9rem rgb(0 0 0 / 0.5); }
.pd-fly .sleeve__shadow, .pd-fly .sleeve__contact { opacity: 0; transition: none; }
.pd-fly.sleeve { perspective: none; }
.pd-fly .sleeve__obj { transform: none; transform-style: flat; transition: none; }
.pd-fly .sleeve__back, .pd-fly .sleeve__side { display: none; }
.pd-fly .sleeve__front { transform: none; }

@media (prefers-reduced-motion: reduce) {
}
@media print {
  .hero2, .closing { min-height: 0; }
  .xp-browser, .xp-detail, .xp-phone, .xp-book { box-shadow: 0 0 0 1px rgb(0 0 0 / 0.2); }
}
