/* The homepage: Madhur's projects as a stack of six-faced volumes, each
   named on its spine, standing on the ground. The geometry's numbers are
   generated into stack-geometry.css and the palettes into themes.css; fonts
   and the theme's roles are shared in base.css; this file decides what the
   home does with them. */

/* The home's one typeface: the projects' names, on the spines and in the
   list, and Madhur's name. */
:root {
  --label-font: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --label-weight: 500;
}

body { background: var(--paper); color: var(--ink); font-family: var(--label-font); }
::selection { background: var(--ink); color: var(--paper); }

/* One screen. Whatever turns or slides past its edges is clipped rather
   than making the page scroll or pan; the page still grows, and scrolls,
   when its content needs the room (enlarged text, the plain list).
   --column is the stack's width: never wider than it can be and still fit
   the screen's height. */
.home {
  --height-fit: calc((100svh - 2 * var(--gutter) - 2.5rem) / var(--stage-height));
  --column: min(100cqi, 32rem, var(--height-fit));
  container: home / inline-size;
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  row-gap: 2rem;
  min-block-size: 100svh;
  padding: var(--gutter);
  overflow: clip;
  isolation: isolate;   /* its layers (below) stay its own */
  touch-action: manipulation;   /* two taps tidy the stack; scrolling and pinch zoom stay native */
  translate: 0 0;   /* a stable containing block for the brief landing tremor */
}

/* The home's layers, bottom to top: the ground, then the
   corner texts lying on it, then the volumes, which pass over the texts when
   they turn, lift or lean past the stack's edges. */

/* The ground: the paving's joints, seen by the same camera as the stack and
   drawn at its scale, running off every edge (the home clips it). Its own
   layer, outside the stack's, so the texts can lie between the two; the
   joints repeat evenly, so where it starts never shows. */
.ground {
  position: absolute;
  z-index: -1;
  inset: 0;
  inline-size: min(100% - 2 * var(--gutter), var(--column));
  block-size: auto;
  margin: auto;
  overflow: visible;
}

/* Madhur's name, small in the bottom corner like a signature on a painting,
   so the work leads. It is still the page's heading. Like the painter's own
   signature lying flat across the roof in Friday, it lies on the ground with
   nothing behind it, the joints running on round the letters. */
/* The two corner texts (the name, the copyright) share one size. */
.home { --corner-size: clamp(1.25rem, 0.9rem + 1.2vw, 1.75rem); }
.name {
  position: absolute;
  z-index: 1;
  inset: auto auto var(--gutter) var(--gutter);
  margin: 0;
  font: 500 var(--corner-size) / 0.88 'Barlow Condensed', 'Arial Narrow', sans-serif;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  text-wrap: balance;
  text-box: trim-both cap alphabetic;
}
.copyright {
  position: absolute;
  z-index: 1;
  inset: auto var(--gutter) var(--gutter) auto;
  font: 500 var(--corner-size) / 0.88 'Barlow Condensed', 'Arial Narrow', sans-serif;
  letter-spacing: -0.005em;
  text-box: trim-both cap alphabetic;
}
/* Where the names fall back to a list under the stack (below: the stack's
   width is the home's, under 19em), the name and the copyright join the column. */
@container home (inline-size < 19em) {
  /* after the list, not beside it; the copyright shares the name's row, in
     the same cell at the other end */
  .name, .copyright { position: static; grid-area: 3 / 1; align-self: end; }
  .name { justify-self: start; max-inline-size: calc(100% - 4.5em); margin: calc(0.5rem + 1em) 0 0; }   /* room for the copyright; wraps if it must */
  .copyright { justify-self: end; }
}

/* The stack: the ground and the shadow underneath, which set the stage's
   size, and the 3D scene lying exactly over them. */
.stack { position: relative; z-index: 2; container: stack / inline-size; align-self: center; inline-size: 100%; max-inline-size: var(--column); }
.art { position: relative; }
.art svg { display: block; inline-size: 100%; block-size: auto; overflow: visible; }
.defs { position: absolute; inline-size: 0; block-size: 0; overflow: hidden; }

/* The 3D scene. No perspective: an orthographic view, matching the
   projection the generator uses to size the stage and lay the ground. Every face carries
   its volume's whole transform (below), so nothing needs a shared 3D space:
   the scene paints the volumes bottom to top, which is always right while
   the camera looks down (a higher volume can only cover a lower one), and a
   volume's visible faces never overlap. No preserve-3d anywhere: sharing a
   3D space made Firefox slice faces into hairline seams, and in preserve-3d
   it stops smoothing edges altogether (Firefox bug 1737904). Lengths come
   from stack-geometry.css. */
/* What places a volume's faces: set on the scene and the volume, inherited
   by the faces (about 30 elements a volume, cheap to restyle each frame).
   Each value eases on its own (see "How the stack moves"); the faces have no
   transition, so a script can drive one value (the spin, the squash) while
   another eases (the pull) without either jumping. */
@property --zoom { syntax: '<number>'; inherits: true; initial-value: 1; }      /* the camera: how close */
@property --tilt { syntax: '<angle>'; inherits: true; initial-value: 0deg; }    /* how far it looks down */
@property --round { syntax: '<angle>'; inherits: true; initial-value: 0deg; }   /* how far round it stands */
@property --rise { syntax: '<number>'; inherits: true; initial-value: 0; }      /* a volume's height, in volumes */
@property --tip { syntax: '<angle>'; inherits: true; initial-value: 0deg; }     /* tipped up about its back edge */
@property --pull { syntax: '<number>'; inherits: true; initial-value: 0; }      /* pointed at (stack-geometry.css) */
@property --press { syntax: '<number>'; inherits: true; initial-value: 0; }     /* pressed */
@property --spin { syntax: '<angle>'; inherits: true; initial-value: 0deg; }    /* turned by the visitor (twist.js) */
@property --lift-angle { syntax: '<angle>'; inherits: true; initial-value: 0deg; }   /* lifted by the visitor, with those above (lift.js); not --lift, the top's light */
@property --squish { syntax: '<number>'; inherits: true; initial-value: 0; }    /* squashed or gulping (enter.js) */
/* The fallbacks in var() keep the stack standing where @property is unknown. */
.scene {
  --zoom: 1;
  --tilt: calc(var(--elev) * -1);
  --round: calc(var(--yaw) * -1);
  position: absolute;
  z-index: 0;
  inset-inline-start: var(--origin-x);
  inset-block-start: var(--origin-y);
}
.volume {
  --rise: var(--level);
  --tip: 0deg;
  position: absolute;
  z-index: var(--level);
  display: block;
  /* This zero-size link wraps transformed faces. A native focus outline
     encloses their flattened bounds (and the shadow) as stray rectangles.
     Show focus on the actual spine instead, through --focus below. */
  outline: none;
}
.volume:focus-visible { --focus: 1; --pull: 1; }
/* A face: seen through the camera; lifted on the hinge when the visitor
   lifts it or a volume beneath it (--hinge, below); its volume raised to its
   level, turned to its place in the twist, tipped, pulled out when pointed at, spun when the
   visitor turns it (twist.js) and squashed onto the stack about its base
   (enter.js); then the face itself, centred on the volume's middle, turned
   to face outward and stepped out to its side. Faces turned away are not
   drawn. */
.face, .volume::before {
  position: absolute;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-origin: 0 0;           /* about the volume's centre, not the face's */
  transform: scale3d(var(--zoom), var(--zoom), var(--zoom)) rotateX(var(--tilt)) rotateY(var(--round)) var(--hinge,)
             translateY(calc(var(--rise) * var(--h) * -1)) rotateY(var(--turn))
             translateY(calc(var(--h) / -2)) rotateX(var(--tip)) translateY(calc(var(--h) / 2))
             translateZ(calc((var(--pull, 0) * 0.2 - var(--press, 0) * 0.08) * var(--d))) rotateY(var(--spin, 0deg))
             scale3d(calc(1 + var(--squish, 0) * 0.08), calc(1 - var(--squish, 0) * 0.22), calc(1 + var(--squish, 0) * 0.08))
             translateY(calc(var(--h) / -2)) var(--turn-face) translateZ(var(--out)) translate(-50%, -50%);
}
.front, .back { inline-size: calc(var(--w) + 1px); block-size: calc(var(--h) + 1px); --out: calc(var(--d) / 2); }
.left, .right { inline-size: calc(var(--d) + 1px); block-size: calc(var(--h) + 1px); --out: calc(var(--w) / 2); }
.top, .bottom { inline-size: calc(var(--w) + 1px); block-size: calc(var(--d) + 1px); --out: calc(var(--h) / 2); }
.front { --turn-face: rotateY(0deg); }
.back { --turn-face: rotateY(180deg); }
.right { --turn-face: rotateY(90deg); }
.left { --turn-face: rotateY(-90deg); }
.top { --turn-face: rotateX(90deg); }
.bottom { --turn-face: rotateX(-90deg); }

/* Touching the stack. A sideways drag turns a volume (twist.js) and an
   upward one lifts it (lift.js), so the browser keeps only zoom there, and a
   drag never picks up the link or selects text; where the page scrolls (the
   plain list, the stack under 19em) vertical drags scroll it instead.
   Pointing at a volume or its name pulls it towards you, out the way it
   faces (--pull, from stack-geometry.css); pressing pushes it back in, but
   only once the finger has stayed put a moment, and never during a turn or a
   lift, so a turn never begins with a dip. Its timing is with the other
   transitions below. */
.art { -webkit-user-select: none; user-select: none; }
.volume { touch-action: pinch-zoom; }
@container stack (inline-size < 19em) { .volume { touch-action: pan-y pinch-zoom; } }
.volume:active { --press: 1; }
.art :is(.turning, .lifting) { cursor: grabbing; }

/* Lifting (lift.js): the volume in the hand (.lift-base) and every volume
   resting on it hinge up together, by --lift-angle, about the back edge of its
   base, like the front of a book lifted to look underneath: the edge nearest
   you rises, whichever face the base rests on. The hinge goes in front of
   each lifted volume's own place in the stack; lift.js gives the base's
   height, its place's turn, and how deep it lies front to back (its depth, or
   its width once it rests on an end). A lifted volume is never pulled out or
   pressed in: the hinge is where it rests. */
.volume.lifting {
  --hinge: translateY(calc(var(--hinge-rise) * var(--h) * -1)) rotateY(var(--hinge-turn))
           translateZ(calc(var(--hinge-depth) / -2)) rotateX(var(--lift-angle)) translateZ(calc(var(--hinge-depth) / 2))
           rotateY(calc(var(--hinge-turn) * -1)) translateY(calc(var(--hinge-rise) * var(--h)));
  --pull: 0 !important;
  --press: 0 !important;
}
/* Lifted past edge-on, the camera sees the lifted volumes from underneath:
   the one in the hand is now the nearest, so they paint top first, still
   above every volume they were lifted off (lift.js says when; 100 is just
   more than any stack's height). */
.volume.lifting.showing-undersides { z-index: calc(100 - var(--level)); }
/* The pull also slides a volume across the screen (the lower ones left, the
   upper ones right, all of them down), so a mouse resting near its edge found
   it slid out from under it: let go, it slid back and was pulled again, over
   and over. So while the mouse is on a volume, each face
   keeps an empty copy where it sits at rest, there only to be pointed at: the
   volume stays pulled while the mouse is over where it is or where it was.
   That is everything it passes over on the way (it slides straight out of
   its place, and its edges that way are several times the slide), so once
   the mouse is off both, the volume never slides back under it. A copy is
   flattened into its face, so it can only step back across the face; the
   pull runs out of the volume's place in the stack, whichever face it rests
   on, so each face takes the share of the pull that lies across it: along
   the volume's depth (--along) for the ends while it faces front, across it
   (--across) for the front and back once it rests on an end, both for the top
   and bottom. A face the pull runs straight through has nothing to cancel,
   and what it leaves behind the others still cover. */
@media (hover: hover) {
  .volume:hover .face::after {
    --back: calc((var(--pull, 0) * 0.2 - var(--press, 0) * 0.08) * var(--d));
    --along: calc(var(--back) * cos(var(--spin, 0deg)));
    --across: calc(var(--back) * sin(var(--spin, 0deg)));
    content: '';
    position: absolute;
    inset: 0;
  }
  .volume:hover .front::after { transform: translateX(var(--across)); }
  .volume:hover .back::after { transform: translateX(calc(var(--across) * -1)); }
  .volume:hover .right::after { transform: translateX(var(--along)); }
  .volume:hover .left::after { transform: translateX(calc(var(--along) * -1)); }
  .volume:hover .top::after { transform: translate(var(--across), calc(var(--along) * -1)); }
  .volume:hover .bottom::after { transform: translate(var(--across), var(--along)); }
}

/* How the stack moves: each value eases on its own. The pull and the press
   answer quickly (pressing in quicker still), the tuning views take their
   time; the spin and the squash are driven by scripts, so they have none. */
.art { --glide: cubic-bezier(0.2, 0.7, 0.2, 1); }
.scene { transition: --zoom 0.8s var(--glide), --tilt 0.8s var(--glide), --round 0.8s var(--glide); }
.volume { transition: --pull 0.35s var(--glide), --press 0.35s var(--glide), --rise 0.8s var(--glide), --tip 0.8s var(--glide); }
.volume:active { transition-duration: 0.35s, 0.08s, 0.8s, 0.8s; transition-delay: 0s, 0.1s, 0s, 0s; }
.volume:active:is(.turning, .lifting) { --press: 0; transition-delay: 0s; }

/* The entrance (arriving.js, twist.js): each time the home opens (not on
   Back or Forward, nor after a room), the stack has just been set down with a turn. From the first paint
   it stands turned a little (Tickets nearly face on) and a hair above the
   ground, its shadows faint, the signature not yet there. Then the bottom
   volume settles home and carries the rest, as a turn does, while the stack
   lands on the ground and its shadow firms; once all is still, the shadows
   under the volumes come back and the signature arrives. Everything is
   readable and working from the first frame, and a touch takes over:
   visitors come for tickets and updates, so there is never a wait. */
:root[data-entrance] .volume { --spin: 20deg; --rise: calc(var(--level) + 0.3); }
:root[data-entrance] .shadow { opacity: 0.15; }
:root:is([data-entrance], [data-settling]) .volume::before,
:root:is([data-entrance], [data-settling]) :is(.name, .copyright) { opacity: 0; }
.shadow { transition: opacity 0.8s var(--glide); }

/* Tuning views, to see every face: turn the camera round, pull the volumes
   apart, or lift the top one and tip it so its underside shows. Names step
   aside while the stack is not at rest. */
[data-view="back"] .scene { --round: calc(180deg - var(--yaw)); }
[data-view="lift"] .p0 { --rise: calc(var(--level) + 2.2); --tip: 62deg; }
/* Spread: the volumes pulled apart and seen from higher, so every cover shows;
   underneath: the same, seen from below, so lower volumes now cover higher
   ones. Scaled down to stay on screen. */
[data-view="spread"] .scene { --zoom: 0.56; --tilt: -45deg; }
[data-view="under"] .scene { --zoom: 0.56; --tilt: 45deg; }
:is([data-view="spread"], [data-view="under"]) .volume { --rise: calc(var(--level) * 4.4); }
[data-view="under"] .volume { z-index: calc(var(--level) * -1); }
.projects { transition: opacity 0.3s; }
:is(.name, .copyright) { transition: opacity 0.6s; }
:root:not([data-view="rest"]) :is(.name, .copyright) { opacity: 0.15; }
:root:not([data-view="rest"]) .projects { opacity: 0; pointer-events: none; }
/* Stepping back for a lift (lift.js): on a desktop the stack fills the
   screen's height, which leaves no room above it to lift the top volumes far
   enough to read underneath. While one is lifted, the stack
   and its ground draw back together, about the stack's foot
   (stack-geometry.css), as far as the lift needs; they come forward again as
   it lands. The corner texts stay put: they are on the picture. */
.stack, .ground { scale: var(--step-back, 1); transition: scale 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { .scene, .volume, .stack, .ground { transition: none; } }

/* The surface. Every face is shaded from its volume's colour: the top catches
   the light, the spines are the colour itself, the ends and underside fall
   into shadow. A sign is a tint of its own volume: dark on a light volume,
   light on a dark one. */
.volume { --c: var(--own); --mark: oklch(from var(--c) clamp(0.28, (var(--mark-flip) - l) * 1000, 0.93) calc(c * 0.5) h); --lift: 18%; --shade: 11%; cursor: pointer; }
/* The matte finish, shared by every volume: broad,
   quiet lighting and a narrow, soft rim suggest a softened edge, without
   rounding six separate rectangles or drawing dark seams (an outline breaks
   into steps on a 1× screen). Each face overlaps its neighbours by half a
   pixel (the + 1px on the faces' sizes above), closing the antialiasing
   hairlines. A browser without gradient colour spaces keeps the solid face
   colour underneath. */
.volume .face {
  --tone: var(--c);
  background-color: var(--tone);
  background-image: linear-gradient(145deg in oklab, color-mix(in oklab, var(--tone), white 6%), var(--tone) 48%, color-mix(in oklab, var(--tone), black 7%));
  box-shadow: inset 0 1px 1px -0.5px color-mix(in oklab, var(--tone), white 18%),
              inset 0 -1px 1px -0.5px color-mix(in oklab, var(--tone), black 15%);
}
.volume .top { --tone: color-mix(in oklab, var(--c), white var(--lift)); }
.volume .left { --tone: color-mix(in oklab, var(--c), black var(--shade)); }
.volume .right { --tone: color-mix(in oklab, var(--c), black calc(var(--shade) * 2)); }
.volume .bottom { --tone: color-mix(in oklab, var(--c), black calc(var(--shade) * 3)); }
.face .print { display: block; inline-size: 100%; block-size: 100%; }
/* Printed over a face's own print: a sealed volume's packaging, and every
   volume's number on its left end. */
.face :is(.packaging, .overprint) { position: absolute; inset: 0; }

/* A contact shadow on the plane just below this volume, drawn before its
   faces. It shares their transform, so turning, pulling and the press carry
   it too. A gradient rather than a blur filter; no extra script or continuous
   rendering. The separated tuning views have no contact shadow. */
.volume::before {
  content: '';
  inline-size: calc(var(--w) + 18 * var(--k));
  block-size: calc(var(--d) + 18 * var(--k));
  --turn-face: rotateX(90deg);
  --out: calc(var(--h) / -2 - 0.6 * var(--k));
  background: radial-gradient(ellipse closest-side in oklab, color-mix(in oklab, var(--c), black 70%) 55%, transparent);
  opacity: 0.2;
  pointer-events: none;
  transition: opacity 0.25s;
}
.volume.hollow::before, :root:not([data-view="rest"]) .volume::before { visibility: hidden; }
/* Lifted, the base's shadow stays on what it was lifted off and fades as it
   leaves; it comes back once the volume lands. */
.volume.lift-base::before { --hinge: initial; opacity: 0; }

/* The project's name on its spine, like a book's title, right of its sign,
   in the volume's mark colour. The links
   that carry the names for keyboards and screen readers are the list below;
   a focused name outlines its spine (--focus, stack-geometry.css). */
.spine-name {
  position: absolute;
  inset: 0 calc(16 * var(--k)) 0 auto;
  display: flex;
  align-items: center;
  color: var(--mark);
  font: var(--label-weight) calc(17 * var(--k)) / 1 var(--label-font);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.front { outline: calc(var(--focus, 0) * 2px) solid var(--mark); outline-offset: calc(var(--focus, 0) * -6 * var(--k)); }   /* inside the spine, in its print colour: outside, the lid and end would cover two of its sides */
/* The values that move a volume are for its faces; nothing printed on them
   uses one. The prints opt out, so a moving volume restyles its faces each
   frame, not every shape printed on them (about a third less work). */
:is(.print, .spine-name) { --zoom: initial; --tilt: initial; --round: initial; --rise: initial; --tip: initial; --pull: initial; --press: initial; --spin: initial; --squish: initial; --lift-angle: initial; --hinge: initial; }

/* The stack stands on the ground (.ground, above) and casts a soft shadow,
   like paper in light. The ground is paving, after the sidewalk in the
   painting the theme comes from. Quiet: 1 px, fainter than the theme's rule
   colour. */
.paving { fill: none; stroke: color-mix(in oklab, var(--rule), var(--paper) 45%); transition: opacity 0.3s; }
:root:not([data-view="rest"]) .paving { opacity: 0; }
.shadow { fill: url(#shadow); opacity: 0.45; }
.shadow-stop { stop-color: color-mix(in oklab, var(--paper), black 38%); }

/* What is printed on the faces: every face of every volume.
   Prints take the volume's mark colour, so they follow the theme. */
.print text { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-weight: 500; fill: var(--mark); }
.tape { fill: color-mix(in oklab, #f3ead3, var(--own) 10%); }          /* cream masking tape */
.print .on-tape { fill: color-mix(in oklab, var(--own), black 55%); }
/* The sealed volumes step back, so Tickets and Updates lead: their tape is
   closer to their colour and their print is faint. */
.sealed .tape { fill: color-mix(in oklab, #f3ead3, var(--c) 38%); }
.sealed .print text { fill-opacity: 0.62; }
.sealed :is(.handling, .numeral) { stroke-opacity: 0.62; }
.tape-fold { fill: color-mix(in oklab, #f3ead3, var(--c) 58%); stroke: color-mix(in oklab, var(--c), black 30%); stroke-width: 0.6; stroke-opacity: 0.5; }   /* a corner lifting, its sticky side showing */
.handling { fill: none; stroke: var(--mark); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }   /* this way up, fragile */
.numeral { fill: none; stroke: var(--mark); stroke-width: 2.6; stroke-linejoin: round; }   /* a Roman numeral between its bars */
.print .fill { fill: var(--mark); }
.print .line { fill: none; stroke: var(--mark); stroke-width: 1.6; }
/* Tickets is the way in to a private room: gold print on the house's dark,
   two brass posts and a velvet rope. The rope is across until the booking
   state is known. While booking is open ticket-status.js unhooks it and the
   words fade in once it lands; otherwise it hangs a brass plate on the rope
   that says why, and the plate waits out of sight until then. */
.volume.tickets { --mark: #c9a96e; --rope: #9a2c33; }   /* champagne gold; deep red velvet */
.post, .plaque-plate, .rope-clasp { fill: var(--mark); }
.rope { fill: none; stroke: var(--rope); stroke-width: 3.6; stroke-linecap: round; }
.plaque-hook { fill: none; stroke: var(--mark); stroke-width: 0.9; }
.deco { fill: none; stroke: var(--mark); stroke-width: 1.1; }
.glass { fill: none; stroke: var(--mark); stroke-width: 1.3; }
.glint { stroke-opacity: 0.5; stroke-linecap: round; }
.lid-line { fill: none; stroke: var(--own); stroke-width: 0.8; }   /* the jar lid's screw ridges */
.plaque { display: none; }
.tickets:is([data-booking="early"], [data-booking="soldout"]) .plaque { display: inline; }
.tickets:is([data-booking="early"], [data-booking="soldout"]):not([data-sign="hung"]) .sign { opacity: 0; }
.tickets[data-sign="hung"] .sign { transition: opacity 180ms ease-out; }
.tickets:is([data-booking="early"], [data-booking="soldout"]) .print .ticket-status { fill: var(--own); }
.tickets[data-booking="open"] .ticket-status { transform: translateY(-7px); }   /* centred between the posts, clear of the rope on the floor */
.tickets[data-booking="open"]:not([data-rope="down"]) .ticket-status { opacity: 0; }   /* hidden at once; it fades in only as the rope lands */
.tickets[data-rope="down"] .ticket-status { transition: opacity 500ms ease-out; }
/* Updates' airmail label, on its spine. */
.mail-label { fill: var(--mail-label); }
.print .on-mail-label { fill: var(--mail-label-ink); }
.stamp { fill: none; stroke: var(--mark); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0 4.5; }
/* Airmail stripes: red, and the page's own colour for the second stripe, so
   they show on Updates' blue in every theme (a fixed navy vanished on a dark
   blue volume). The pattern lives outside the volume, so only theme-wide
   colours reach it. */
.airmail { fill: url(#airmail); }
.air-red { fill: #b9463b; }
.air-blue { fill: var(--paper); }

/* The names as links, in stack order: a plain list under the drawing when
   space is short or text is large; otherwise out of sight beside the printed
   spines, still there for keyboards and screen readers. */
.projects { margin: 1.25rem 0 0; padding: 0; list-style: none; }
.projects :is(a, .sealed) {
  display: flex;
  align-items: center;
  min-block-size: 2.75rem;
  color: inherit;
  font-weight: var(--label-weight);
  font-size: 0.8125rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-decoration: underline 1px color-mix(in srgb, currentColor calc(var(--pull, 0) * 100%), transparent);
  text-underline-offset: 0.45em;
  text-transform: uppercase;
  transition: text-decoration-color 0.25s;
}
.projects a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.projects .sealed { text-decoration: none; color: color-mix(in oklab, currentColor, transparent 40%); }   /* not open yet: no link */
:where(.projects li + li) { border-block-start: 1px solid var(--rule); }

@container stack (inline-size >= 19em) {
  .projects { position: absolute; inline-size: 1px; block-size: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* On desktop the stack is sized by the screen's height, filling most of it,
   so a 1× monitor gives the faces and prints enough pixels. */
@media (min-width: 60rem) {
  .home { --column: min(100cqi, var(--height-fit)); }
}

/* The way into a project and back (enter.js): its colour spills out of the
   chosen volume as a blob (blob.js) over the whole page until the room
   opens, and coming back the volume swallows it again. */
.flood { position: fixed; inset: 0; z-index: 10; background: var(--own); pointer-events: none; visibility: hidden; }
.flood.covering { visibility: visible; }
/* A fresh home opening just after a room was left (arriving.js): covered in
   the room's colour from its first paint, until the flood takes over and
   pours it back (enter.js). */
:root[data-arriving] body::after { content: ''; position: fixed; inset: 0; z-index: 10; background: var(--arriving); }
/* While its colour is out, the volume stands hollow: only its outline, in
   its own colour, until the colour pours back into it. Set on the faces
   rather than through --c, and the prints only faded, so the switch restyles
   a few faces, not every shape printed on them. */
.art .volume.hollow .face { background: var(--paper); box-shadow: inset 0 0 0 1px var(--own); }
.art .volume.hollow :is(.print, .spine-name) { opacity: 0; }

/* The tuning panel (tuning.js), opened with ?tune: themes and views.
   Not part of the design: dashed so it never reads as such, and sized in px
   so enlarged-text checks judge the page, not the panel. */
body:has(.tuning:not([hidden])) .home { padding-block-start: max(var(--gutter), 3.5rem); }   /* room for it, within the screen */
.tuning {
  position: fixed;
  inset: 8px 8px auto auto;   /* the top right, clear of the corner texts */
  max-inline-size: calc(100vw - 16px);
  padding: 4px;
  border: 1px dashed var(--quiet);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  font: 400 12px / 1 system-ui, sans-serif;
  overflow: clip;   /* closed, its hidden contents would reach past the screen */
}
.tuning summary { display: flex; align-items: center; justify-content: end; min-block-size: 32px; padding: 0 10px; list-style: none; cursor: pointer; }
.tuning summary::-webkit-details-marker { display: none; }
.tuning [role="group"] { display: flex; flex-wrap: wrap; justify-content: end; gap: 2px; padding-block: 4px; border-block-start: 1px dashed var(--rule); }
.tuning [aria-label="Theme"] { flex-direction: column; align-items: stretch; gap: 6px; }
.theme-picker { display: flex; gap: 2px; }
.theme-picker select { flex: 1; min-inline-size: 0; min-block-size: 32px; padding: 0 6px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; }
.swatches { display: grid; grid-template-columns: repeat(16, 1fr); block-size: 14px; border-radius: 3px; overflow: hidden; }
.tuning button {
  min-block-size: 32px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.tuning button[aria-pressed="true"] { border-color: var(--ink); }
