/* ==========================================================================
   Buttercup Café — home
   Page-specific layout: the café hero, the Q&A room, the project board.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Hero
   -------------------------------------------------------------------------- */

/* The landing screen is exactly one viewport tall. Everything inside is sized
   against viewport height so it scales to fit rather than being clipped; the
   min-height is a floor for very short windows, where growing and scrolling
   beats cutting the café in half. */
.hero {
	position: relative;
	display: grid;
	grid-template-rows: 1fr auto;
	align-items: center;
	height: 100svh;
	min-height: 34rem;
	padding-block: var(--sp-8) var(--sp-6);
	background: var(--bg-desk);
	overflow: hidden;
}

.hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 26rem) minmax(0, auto);
	align-items: center;
	justify-content: center;
	gap: clamp(var(--sp-4), 2.5vw, var(--sp-10));
	width: 100%;
	max-width: 78rem;
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* -- left column: who this is, and what she is saying ------------------ */

/* Stretched to the café's height, so this column's bottom edge *is* the
   café's bottom edge — the pavement she is standing on. The panel takes the
   bottom row of it, which is what puts her circle and her words on the same
   line at every window shape, with no magic numbers and nothing to keep in
   sync if the café art changes. The identity block centres itself in
   whatever is left above.

   The stretch is also what makes the `1fr` safe: inside a definite height,
   the flexible row is just "the rest", with none of the guesswork that
   sizing an fr against an indefinite height involves. */
.hero__voice {
	align-self: stretch;
	display: grid;
	grid-template-rows: 1fr auto;
	row-gap: var(--sp-5);
}

.hero__intro {
	align-self: center;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp(var(--sp-2), 1.4vh, var(--sp-4));
}

.hero__name {
	font-size: clamp(2.75rem, 1.6rem + 4.4vw, 4.75rem);
	line-height: 0.95;
	letter-spacing: -0.045em;
	color: var(--ink);
}

.hero__role {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sp-1) var(--sp-2);
	font-family: var(--ff-display);
	font-size: var(--fs-400);
	font-weight: 500;
	color: color-mix(in oklab, var(--ink) 74%, var(--sage));
}

.hero__role span:not(:last-child)::after {
	content: "·";
	margin-inline-start: var(--sp-2);
	color: color-mix(in oklab, var(--ink) 40%, var(--sage));
}

.hero__where {
	font-family: var(--ff-display);
	font-size: var(--fs-300);
	color: color-mix(in oklab, var(--ink) 58%, var(--sage));
}

/* A wrapper around the text box that exists for one reason: below 48rem it
   also holds her portrait, and the two have to overlap. In the wide layout it
   is a single-child box that changes nothing. */
.hero__say {
	display: grid;
	justify-items: center;
	width: 100%;
}

/* The narrow-screen portrait. Absent from the wide layout entirely — she is
   standing outside the café there, and this is the same person. */
.hero__chibi {
	display: none;
}

/* -- right column: the shop, with her standing outside it -------------- */

/* The 1.357 is the café sprite's own aspect ratio, so capping against
   viewport height keeps the whole shop on screen at any window shape. */
.hero__scene {
	position: relative;
	width: min(100%, 48rem, 70vh * 1.357);
	justify-self: center;
}

.hero__shop {
	width: 100%;
	image-rendering: pixelated;
}

/* She stands on the pavement at the front of her own café. That adjacency is
   the whole link: the shop on the sign is hers, and the words in the box to
   the left are what she is saying to you. */
.hero__scene .chibi {
	position: absolute;
	inset-block-end: -1%;
	inset-inline-start: 1%;
	width: 27%;
	padding: 1.1rem;
}

.hero__scene .chibi__sunflower {
	width: 42%;
}

/* -- scroll cue -------------------------------------------------------- */

.hero__cue {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: var(--sp-1);
	justify-self: center;
	font-family: var(--ff-display);
	font-size: var(--fs-200);
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: color-mix(in oklab, var(--ink) 55%, var(--sage));
	transition: color var(--dur) var(--ease-out);
}

.hero__cue:hover {
	color: var(--ink);
}

.hero__cue svg {
	width: 1.25rem;
	animation: cue-bob 2.4s ease-in-out infinite;
}

/* -- stacked ----------------------------------------------------------- */

@media (max-width: 60rem) {
	.hero__inner {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
		gap: var(--sp-5);
	}

	/* The shop leads on a narrow screen — it is the landing image. */
	.hero__scene {
		order: -1;
		width: min(100%, 30rem, 34vh * 1.357);
	}

	/* Nothing to align to once the café is above rather than beside it. */
	.hero__voice {
		align-self: auto;
		justify-items: center;
		width: 100%;
	}

	.hero__intro {
		align-items: center;
		text-align: center;
	}

	.hero__role {
		justify-content: center;
	}
}

/* -- phone: she comes and sits on the box ------------------------------ */

/* On a screen this narrow the hero has room for one idea, so it is reduced to
   the introduction itself: the café, her name, her face and what she is
   saying. The two lines of credentials below the name are cut here — not
   because they stop mattering, but because on a phone they push her voice
   below the fold, and the same words are three inches further down the page
   anyway.

   She leaves the pavement at the same width. Shrunk to fit a 30rem café she is
   a smudge in the corner; sat on the top edge of the text box at twice that
   size, she is legible and she is obviously the one talking — which is what
   the tail pointing across at her did in the wide layout, and there is no room
   for a tail here. 48rem rather than the 60rem the columns stack at: between
   the two there is still width for the café to carry her. */
@media (max-width: 48rem) {
	.hero__role,
	.hero__where {
		display: none;
	}

	.hero__scene .chibi {
		display: none;
	}

	/* Authored here rather than on the portrait because the box needs the dip
	   too — it is how far its own top padding has to move out of her way. One
	   number, two users, no chance of them drifting apart. */
	.hero__say {
		--chibi-size: clamp(6.5rem, 27vw, 8.5rem);
		--chibi-dip: calc(var(--chibi-size) * 0.42);
	}

	.hero__chibi {
		/* Only so she can be stacked above the box: later siblings paint over
		   earlier ones, and the box is the later sibling. */
		position: relative;
		z-index: 1;
		display: grid;
		width: var(--chibi-size);
		padding: 1rem;
		/* Overlap by pulling the box up, not by lifting her out of the flow:
		   in flow she still contributes her top half to the column's height,
		   so nothing above her has to know she is there. */
		margin-block-end: calc(var(--chibi-dip) * -1);
	}

	.hero__chibi .chibi__sunflower {
		width: 40%;
	}

	.saypanel--hero {
		padding-block-start: calc(var(--chibi-dip) + var(--sp-3));
	}

	/* Her face is sitting on the box and her name is the heading above it.
	   A third "Dimah" in between is one too many. */
	.saypanel--hero .saypanel__who {
		display: none;
	}
}

@keyframes cue-bob {
	0%,
	100% {
		translate: 0 0;
	}
	50% {
		translate: 0 5px;
	}
}

/* --------------------------------------------------------------------------
   2. Q&A room

   One screen, with the jar in the middle of it. The section is sized in
   `svh` rather than `vh` so the mobile URL bar sliding away does not resize
   the room out from under a note that is already open, and `min-height`
   rather than `height` so that a genuinely short window gets a scrollbar
   instead of a note running off the bottom edge.
   -------------------------------------------------------------------------- */

.section--room {
	display: grid;
	align-content: center;
	min-height: 100svh;
}

/* Everything in the room is positioned against this box: the stage is the
   only child in normal flow, so the room is exactly the stage's height and
   she can be hung off its bottom-left corner. */
.qa {
	position: relative;
	display: grid;
	justify-items: center;
	width: 100%;
}

/* 22% and not a round number: an open letter is `--note-w` centred in the
   room, so the gap down each side is `(100% − --note-w) / 2`, and at the
   narrowest width the jar is ever shown that gap is comfortably more than a
   fifth of the room. She fills a fifth and stops. Any wider and her
   sunflower reaches for the paper at exactly the moment the letter opens. */
.qa__host {
	display: grid;
	justify-items: center;
	gap: var(--sp-3);
	width: min(13rem, 22%);
	margin-block-start: var(--sp-8);
}

/* She steps out of the flow and into the corner of the room, because the jar
   has to be the thing in the middle — given a column of her own she pushes it
   off-centre, and given a row of her own she pushes the room off the bottom
   of the screen. That second one is why this breakpoint is 48rem and not
   wider: 48rem is exactly where the jar starts being shown at all, so there
   is no band left where she is in flow and the room still has to fit one
   viewport. */
/* 48.01rem and not 48rem: the phone block at the end of this section owns
   everything up to and including 48rem, and at exactly that width both used
   to apply — which hung her bubble, portrait-less by then, in the corner of a
   full-bleed stage. The two ranges have to meet without overlapping. */
@media (min-width: 48.01rem) {
	.qa__host {
		position: absolute;
		inset-block-end: 0;
		inset-inline-start: 0;
		margin-block-start: 0;
	}
}

/* ---- the stage ---------------------------------------------------------- */

/* The jar is an enhancement layered over the plain list, so it is absent by
   default and the list is present. Both swaps are made here rather than in
   JavaScript, which means a reader who turns reduced motion on or off gets
   the other one immediately instead of on the next reload — and it means the
   no-JS page never flashes a jar it is about to hide.

   The stage's height is fixed, not grown from its contents: every child is
   absolutely positioned, so there is nothing in it to grow from. That is what
   keeps the room the same size whether a note is out or not, and it is the
   number the whole section is budgeted against — jar, note and all three fold
   depths are expressed as fractions of it, so shrinking the room on a short
   window moves everything together instead of pulling it apart. */
.qa__stage {
	/* Mirrored in js/modules/jar.js as FLY. The fold's own duration is not
	   here — it belongs to the paper, and lives on `.note` in components.css
	   §9b. Change whichever one you mean, and its twin in the module. */
	--dur-fly: 520ms;

	/* The numbers the room is budgeted from, and they are budgeted against
	   each other rather than picked.

	   One panel is the unit of the whole design, because the note is a letter
	   folded in three: the packet in the jar is one panel, and the letter open
	   on the stage is three of them stacked. So the stage has to hold
	   `3 × --panel-h` and nothing taller, ever, whatever the answer says —
	   which is the whole of the first line below, less a little air.

	   The letter's proportion is then fixed, not its width: `--note-ratio` is
	   width over panel height, and it is a bare number because the slip in
	   the jar is the same packet and needs it for an `aspect-ratio`, which
	   cannot divide two lengths. 2.75 is about as long as a folded letter
	   gets before it starts reading as a ribbon, and it is what gives the
	   middle panel — the one that has to hold a whole answer, since text does
	   not run across a crease — room for the longest of the five at the
	   smallest the room is ever drawn.

	   `--flap` is how much of a panel the top flap is. A little short of a
	   whole one, so that shut it leaves a strip of the fold underneath
	   showing — which is most of what makes the slips in the jar read as
	   folded letters rather than as coloured cards.

	   `--jar-w` is then as large as the leftover will allow. A jar much
	   smaller than this stops being the middle of the room and starts being a
	   decoration standing in front of a note, and the room is called Q&A Jar.
	   It is a *width*, and the drawing is half again as tall as it is wide
	   (components.css §10), so the number that has to clear the room is
	   `--jar-w × 80/54` — which is where the 0.56 comes from, not taste. */
	--stage-h: clamp(24rem, 62svh, 30rem);
	--note-ratio: 2.75;
	--flap: 0.8;
	--panel-h: clamp(7.5rem, calc((var(--stage-h) - var(--sp-6)) / 3), 9.5rem);
	--note-w: calc(var(--panel-h) * var(--note-ratio));
	--jar-w: clamp(12rem, calc(var(--stage-h) * 0.56), 17rem);

	position: relative;
	display: none;
	/* The plant's PNG is two thirds empty air (see `.qa__plant`), so its box
	   reaches a long way past the leaves — far enough, on a narrow desktop
	   window, to widen the document and put a scrollbar along the bottom of
	   the page over pixels nobody can see. Contained per-section, which is the
	   same call base.css §root makes and for the same reason: clipping the
	   root instead kills every scroll-triggered entrance on the page.

	   One axis only, and `clip` is the one value that may be paired with
	   `visible` — the leaves are *meant* to grow up out of the room and stand
	   behind the heading, so the vertical axis has to stay open. Nothing else
	   in here comes near an edge: the open letter is at most `--note-w` on a
	   stage that is always wider. */
	overflow-x: clip;
	overflow-y: visible;
	width: 100%;
	height: var(--stage-h);
}

.js .qa__stage {
	display: block;
}

.js .qa__list {
	display: none;
}

/* Dead centre, and it stays there. An earlier version sent the jar sliding
   aside to make room, which is the wrong instinct twice over: the jar is the
   thing the section is about, and a jar that gets out of your way when you
   take something out of it is not behaving like a jar. */
.qa__stage .jar {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	z-index: 1;
	width: var(--jar-w);
	translate: -50% -50%;
	transition: filter var(--dur-fly) var(--ease-out),
		opacity var(--dur-fly) var(--ease-out);
}

/* It does not move and it does not change size — it goes *behind*. The
   paper is the only thing in the room that moves; the jar just falls out of
   focus and fades, which is a camera's cue for depth and the honest one here,
   because the letter really is nearer to you than the jar is. */
.qa__stage.has-note .jar {
	opacity: 0.55;
	filter: blur(2px);
}

/* The plant standing behind the jar.

   Placed against the same centre the jar is, and sized from `--jar-w` rather
   than from the room, because the only thing this drawing has to be right
   about is how big it is *next to the jar* — anchored to the room instead it
   drifts out of scale with the object it is standing behind on every window
   that reshapes the stage.

   Two numbers are being said at once here, and they have to be read apart or
   none of the four constants make sense.

   What the *drawing* is meant to do is stand one jar wide, with its top-left
   corner at `0.216 × --jar-w` right of the room's centre and `1.382 × --jar-w`
   above it. `-1.382` is the only number in this rule that had to be found
   rather than derived — it is what puts the pot on the floor the jar stands on
   rather than somewhere in the air above it.

   What is actually being positioned, though, is the *file*, and the file is
   mostly nothing: the leaves and pot occupy x 180…370, y 45…426 of a 549×454
   canvas, so the drawing is 190 across where its box is 549. Hence `2.8895`
   (549/190) to get the art to one jar wide, and hence the placement carrying
   the drawing's own offset inside the canvas back out of itself — `0.216 −
   180/190` and `−1.382 − 45/190`. Change where the plant should stand and the
   two subtractions stay; only the leading terms move.

   `pixelated` for the same reason `.jar__art` has it: this is a bitmap going
   up past 1:1, and the default resample would soften every pixel edge.

   It is taller than the room by design — the leaves grow up past the top of
   the stage and stand behind the heading, which is why the stage clips one
   axis and not the other.

   `left: 50%` plus a length is the only safe way to say this: a percentage in
   `translate` resolves against the element's own box, so the same intent
   written as a percentage would be measured against the plant instead of
   against the jar and land it somewhere else.

   `z-index: -1` and not 0: 0 would still paint it over the section heading,
   because the heading is unpositioned text and the plant is a positioned box.
   Negative puts it behind everything painted in this stacking context and in
   front of nothing but the page itself, which is exactly where a thing at the
   back of the room belongs. */
.qa__stage .qa__plant {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	z-index: -1;
	/* `max-width: none` for the same reason `.jar__art` needs it — this box is
	   almost three jars wide on purpose, and base.css caps images at 100%. */
	width: calc(var(--jar-w) * 2.8895);
	max-width: none;
	height: auto;
	translate: calc(var(--jar-w) * -0.7314) calc(var(--jar-w) * -1.6188);
	image-rendering: pixelated;
	pointer-events: none;
	transition: opacity var(--dur-fly) var(--ease-out),
		filter var(--dur-fly) var(--ease-out);
}

/* It recedes with the jar, and further. Depth of field falls off with
   distance, so the thing standing behind the out-of-focus object cannot be
   the sharp one — a crisp plant behind a blurred jar reads as a sticker on
   the page rather than as something in the room. */
.qa__stage.has-note .qa__plant {
	opacity: 0.4;
	filter: blur(3px);
}

/* Two poses and the flights between them: folded, lying exactly where its
   slip lay in the jar; or open, in the middle of the room in front of the
   glass. Only the second is written here as numbers. The first is wherever
   the slip happens to be, which only layout knows — so js/modules/jar.js
   measures the slip and hands over four custom properties, `--from-x`,
   `--from-y`, `--from-scale` and `--from-rot`, and every pose is still
   authored here. The script writes a measurement, never a frame.

   That is what makes taking a slip read as *picking it up*. The letter
   appears on the same frame the slip disappears, at the slip's size, at its
   angle, in its place — and it is the same picture, because the slip is
   drawn as the letter's outside (components.css §10). Then it straightens,
   grows and comes forward to you.

   At rest it is `visibility: hidden` as well as transparent, and that is not
   belt and braces: the close button and the links inside it would otherwise
   still be in the tab order while it lies invisible in the jar.

   And at rest it has no transitions at all, which is the other half of the
   trick. The from-pose has to be *snapped* into before the flight starts —
   otherwise moving it from the last slip taken to this one would itself be
   animated, invisibly, and the flight would start from wherever that got to.

   The note's *box* never changes — it is the middle panel, always. Only
   `translate`, `scale` and `rotate` differ between the poses; `inset` and
   `width` would have to be in the transition list to animate at all, and
   putting them there animates layout sixty times a second.

   `translate` gets `--ease-out` and not the spring: paper that overshoots its
   landing and comes back is paper that is still being acted on after it has
   come to rest. The spring is left on `scale` on the way out, where the
   overshoot reads as the letter being lifted up to you. On the way back it
   is put down, not thrown, and everything eases out. */
.qa__stage .note {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	z-index: 2;
	translate: calc(-50% + var(--from-x, 0px)) calc(-50% + var(--from-y, 0px));
	scale: var(--from-scale, 0.4);
	rotate: var(--from-rot, 0deg);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.qa__stage .note.is-out,
.qa__stage .note.is-back {
	opacity: 1;
	visibility: visible;
}

.qa__stage .note.is-out {
	translate: -50% -50%;
	scale: 1;
	rotate: 0deg;
	pointer-events: auto;
	transition: translate var(--dur-fly) var(--ease-out),
		scale var(--dur-fly) var(--ease-spring),
		rotate var(--dur-fly) var(--ease-out);
}

.qa__stage .note.is-back {
	transition: translate var(--dur-fly) var(--ease-out),
		scale var(--dur-fly) var(--ease-out),
		rotate var(--dur-fly) var(--ease-out);
}

/* The one case that gets the plain list instead of the jar. Same specificity
   as the `.js`-scoped rules above, and later in the file, so this wins.

   Reduced motion, and only reduced motion. A jar with its animations switched
   off is not a calmer jar, it is a decoration sitting in front of the content.

   This used to catch two more cases, and both have been answered rather than
   dropped. A coarse pointer is fine: a slip is a click target and a tap is a
   click — nothing here needs hover to be discoverable, because the letter
   opens itself once it is taken. And below 48rem the room is re-solved (see
   the phone block at the end of this section) rather than abandoned: the
   letter takes the screen's width and the room is built down from that. The
   jar is the section, so a phone should get the jar.

   The list is not a consolation prize either. It is a <details> per question,
   which is a fold that needs no script — the same gesture, plainly. */
@media (prefers-reduced-motion: reduce) {
	.section--room {
		display: block;
		min-height: 0;
	}

	.js .qa__stage {
		display: none;
	}

	.js .qa__list {
		display: grid;
	}
}

.qa__list {
	margin-block-start: var(--sp-8);
}

/* ---- the room on a phone ------------------------------------------------ */

/* The same room, re-solved for a screen that is taller than it is wide. Two
   things change, and the second is forced by the first.

   1. The stage goes full bleed. A letter wants all the width a phone has,
      so the room takes the wrap's gutters back — as negative margins that
      cancel the padding, never as a `100vw` width, which counts a scrollbar
      the wrap does not have and would put one along the bottom of the page.
      The stage is exactly the screen from that point on, so the letter is
      centred on the *screen*, and the plant crops at the screen's edge
      rather than at a line inside the page, which is the difference between
      a thing standing off the side of the room and a picture cut short.
   2. The budget runs the other way. On a laptop the room's height is the
      scarce thing, so the panel is cut from the height and the width follows
      from the ratio; on a phone it is the width, so the letter takes the
      screen less a margin, the panel follows from that, and the room is
      however tall three panels are. The ratio does not change, so the slips
      in the jar do not have to either.

   If three panels overflow a very short window the section scrolls, which is
   the behaviour `min-height` was chosen for — an answer cut off by a panel
   it does not fit in would not be. */
@media (max-width: 48rem) {
	/* The room is one screen or it is nothing, and on a phone every band above
	   the stage is spent out of the same 812-odd pixels the note needs. These
	   two are the cheapest to give back: the room's own padding, and the air
	   under its heading. */
	.section--room {
		padding-block: var(--sp-10);
	}

	.section--room .section-head {
		margin-block-end: var(--sp-5);
	}

	.qa__stage {
		/* `100vw` is safe here and only here: it sizes a box that sits in the
		   middle of a full-bleed stage, with a margin taken off, so it can never
		   be what pushes the page wider. */
		--note-w: min(24rem, calc(100vw - var(--sp-8)));
		--panel-h: calc(var(--note-w) / var(--note-ratio));
		--stage-h: calc(var(--panel-h) * 3 + var(--sp-6));
		/* Deliberately most of the room's width, and a bigger fraction of it
		   than the desktop stage gives the jar. There the jar has a whole
		   room to be the middle of; here it is competing with a sheet of
		   paper that is nearly the width of the screen, and a jar that reads
		   as an ornament next to the note has stopped being what the section
		   is named after. The plant is sized from this number, so the two
		   grow together — see `.qa__stage .qa__plant`.

		   The ceiling is what the *stage* can hold, not what the room can:
		   0.56 of the stage is the tallest jar that still fits it, since the
		   drawing is 80/54 as tall as it is wide. */
		--jar-w: min(17rem, calc(var(--stage-h) * 0.56));

		justify-self: stretch;
		width: auto;
		margin-inline: calc(var(--gutter) * -1);
	}

	/* The letter keeps its vertical padding and gives back some of its side
	   padding — on a column this narrow four pixels either side is most of a
	   word per line, and lines are the thing the answer panel is short of. */
	.qa__stage .note__face {
		padding-inline: var(--sp-4);
	}

	.qa__stage .note__from {
		inset-inline-start: var(--sp-4);
	}

	/* She turns side-on: portrait first, then the line she is saying, in one
	   row under the jar. Stacked she is two bands tall and the room is one
	   screen — side by side she is one, and the band is her own height rather
	   than her height plus the bubble's.

	   The tail goes. It points down at where she used to be, and a bubble that
	   points past its speaker is worse than one that does not point at all;
	   sitting against her shoulder it does not need to say whose voice it is.

	   `order` and not a second copy in the markup: the bubble is first in the
	   DOM because that is the reading order — her line is the content, the
	   drawing is decoration with an empty alt — and that stays true whichever
	   side of it she is drawn on.

	   The row is anchored to the left edge and not centred, and that is the
	   whole point of the two tracks. Her lines are all different widths,
	   and a shrink-wrapped row centred in the room re-centres itself on every
	   one of them — so she slid sideways each time the bubble changed, which
	   is the one thing in this section that is supposed to be furniture. A
	   fixed column for her and the rest of the row for the words means the
	   only thing a longer line can move is its own right-hand edge.

	   `minmax(0, 1fr)` and not `1fr`: a grid track's automatic minimum is its
	   content's min-content width, so the bubble's longest word would push the
	   track — and her with it — past the room rather than wrapping. And the
	   row's height is hers, because she is taller than two lines of bubble;
	   the band under the jar is the same height whatever she says. */
	.qa__host {
		grid-auto-flow: column;
		grid-template-columns: auto minmax(0, 1fr);
		align-items: center;
		justify-items: start;
		gap: var(--sp-3);
		justify-self: stretch;
		width: auto;
		margin-block-start: var(--sp-3);
	}

	/* Left inside the bubble too, for the lines long enough to wrap: the box
	   is against her shoulder, so its text starts where she does. */
	.qa__host .bubble {
		text-align: start;
	}

	.qa__host .chibi {
		order: -1;
		width: 5.5rem;
		padding: 0.7rem;
	}

	.qa__host .chibi__sunflower {
		width: 2rem;
	}

	.qa__host .bubble::after,
	.qa__host .bubble::before {
		content: none;
	}

	/* The float belongs to a bubble hanging over someone's head, where a
	   little drift reads as a thought that is still in the air. Sitting on the
	   line beside her it is a caption, and a caption that will not keep still
	   next to a portrait that does is just one of the two shaking. */
	.qa__host .bubble.is-in {
		animation: none;
	}
}

/* --------------------------------------------------------------------------
   3. Project board — the table

   Two layouts live here and which one applies is decided by JavaScript.

   Without `.is-stage` — scripting off, reduced motion, or a touch screen —
   the board is an ordinary two-up grid of cards in normal flow, nudged by the
   --rest-* values authored inline in the markup. That is what the HTML means
   on its own, and it is a perfectly good board.

   With `.is-stage`, the board becomes a table exactly one viewport tall and
   the cards become sheets of paper lying on it, absolutely positioned.
   js/modules/cards.js writes three numbers per card — --x, --y, --rot — and
   everything below describes what happens *between* two sets of those
   numbers. CSS owns all of the motion; JS never animates anything.
   -------------------------------------------------------------------------- */

.board-section {
	/* `clip`, not `hidden` — hidden would make this a scroll container and
	   break the sticky nav. Both axes, because cards are thrown in from above
	   the table and have to be invisible until they enter it; without the
	   vertical clip they would be seen hanging over the section above. */
	overflow: clip;
}

/* ---- fallback: cards in normal flow ------------------------------------- */

.board {
	display: grid;
	justify-items: center;
	gap: var(--sp-10) var(--sp-8);
	max-width: 60rem;
	margin-inline: auto;
	/* Contains a lifted card's z-index so it can never paint over the nav. */
	isolation: isolate;
}

/* Two up, with the right-hand column dropped half a card so the board reads
   as a staggered brick rather than a table. */
@media (min-width: 64rem) {
	.board:not(.is-stage) {
		--brick: 7rem;
		grid-template-columns: repeat(2, auto);
		gap: var(--sp-12) var(--sp-10);
		padding-block-end: var(--brick);
	}

	.board:not(.is-stage) .card:nth-child(even) {
		--rest-y: var(--brick);
	}
}

/* On a narrow screen there is no room to scatter sideways. The offsets are
   authored inline per card, so they need !important to be unset. */
@media (max-width: 40rem) {
	.board:not(.is-stage) .card {
		--rest-x: 0px !important;
	}
}

.board__foot {
	display: flex;
	justify-content: center;
	margin-block-start: var(--sp-12);
}

/* The button only does anything once the drag module is running, and the
   module deletes it outright when it bows out. This covers the remaining
   case: no JavaScript at all. */
.board__toss {
	display: none;
}

.js .board__toss {
	display: inline-flex;
}

/* ---- the table ---------------------------------------------------------- */

/* One viewport, no more. Every pixel spent on chrome around the stage is a
   pixel the cards have to give back by shrinking, so the section's usual
   generous rhythm is cut right down here. */
.board-section.is-table {
	padding-block: 0;
}

.board-section.is-table > .wrap {
	display: flex;
	flex-direction: column;
	min-height: 100svh;
	/* Wider than the site's usual measure: the cards want room, and this is
	   the one section that is a picture rather than a column of text. */
	max-width: 100rem;
	/* The nav is fixed, so the top of the section sits underneath it. */
	padding-block: calc(3.75rem + var(--sp-6)) var(--sp-8);
}

.board-section.is-table .section-head {
	margin-block-end: var(--sp-6);
}

.board-section.is-table .board__foot {
	margin-block-start: var(--sp-6);
}

/* The stage takes whatever height the flex column has left over. It must
   carry no padding of its own: absolutely positioned children are placed from
   the padding edge, and the JS measures the border box — the two have to
   agree or every card sits offset by the padding. */
.board.is-stage {
	position: relative;
	display: block;
	flex: 1;
	width: 100%;
	max-width: none;
	min-height: 16rem;
	gap: 0;
	padding: 0;
}

/* --w / --h are written by the module, sized so the whole scatter fits the
   stage. They are deliberately not the global --card-w / --card-h tokens: the
   fallback board still wants those, unchanged. */
.board.is-stage .card {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	margin: 0;
	width: var(--w, 26.5rem);
	min-height: var(--h, 19rem);

	/* Type and padding scale with the sheet, so a card shrunk to fit a small
	   window is the same drawing at a smaller size rather than the same text
	   in a tighter box. 26.5 is the authored card width in rem, which makes
	   this exactly 1rem at full size.

	   The floor is where that idea stops being true. Eight cards on a phone
	   are about a third of the authored width, and a third of 16px is 6px —
	   at which point the sheet is not a small drawing, it is an unreadable
	   one. 0.625rem is the smallest this type is allowed to get; below it the
	   card stops scaling and starts simply being small. */
	font-size: max(calc(var(--w, 26.5rem) / 26.5), 0.625rem);

	/* Every step the card's own children measure themselves in, restated in
	   `em` so they come down with the sheet. Each value is the one the token
	   already holds at full size — 0.75em of 16px *is* --fs-100's 0.75rem —
	   so a desktop card is unchanged to the pixel, and only a shrunk one is
	   affected. Without these the chips and the plaque kept their rem sizes
	   while everything around them halved, and a card at a third scale wore
	   tags bigger than its own title. */
	--fs-100: 0.75em;
	--fs-200: 0.8125em;
	--fs-300: 0.9375em;
	--fs-500: 1.1875em;
	--fs-600: 1.5em;
	--sp-1: 0.25em;
	--sp-2: 0.5em;
	--stitch-inset: 0.5em;
	/* The thread was the one part of the sheet still measured in px, so a card
	   at a third scale wore the same 3px dashes as a full-size one and the
	   stitch read as a rope. 0.1875em is that same 3px at full size. */
	--stitch-w: 0.1875em;
	gap: 0.75em;
	padding: calc(var(--stitch-inset) + var(--stitch-w) + 1em);

	translate: var(--x, 0px) var(--y, 0px);
	rotate: var(--rot, 0deg);

	/* No transition on translate or rotate, ever. Those two are written every
	   frame by the flight loop in cards.js, and a transition on top of a
	   simulation does not smooth it — it lags it, turning a card falling under
	   gravity into a card easing towards wherever it was a frame ago. Scale
	   and opacity are the only things CSS still animates here, and neither is
	   ever touched by the physics. */
	transition: scale var(--dur) var(--ease-out);
}

/* The last two rem values inside a card, for the same reason as the block
   above and with the same arithmetic: at full size `em` and `rem` are the same
   number here, so this changes nothing on a desk and everything on a phone. */
.board.is-stage .card .chip {
	padding-block: 0.15em;
}

.board.is-stage .card .plaque {
	padding-block: 0.2em;
	font-size: 0.625em;
}

/* Promoted only while something is actually moving — the whole board for the
   length of a throw, a single card for the length of a drag. Eight layers
   permanently promoted, each carrying a soft shadow, costs real GPU memory
   and leaves text fuzzy in Safari. */
.board.is-stage.is-live .card,
.board.is-stage .card.is-drag {
	will-change: translate, rotate;
}

/* Hidden until the first throw, which starts from off the top of the table. */
.board.is-stage .card {
	opacity: 0;
}

.board.is-stage.is-dealt .card {
	opacity: 1;
}

.board.is-stage .card.is-drag {
	cursor: grabbing;
	--lift: 1.04;
	--z-boost: 2000;
}

/* ---- the table on a phone ----------------------------------------------- */

/* Eight sheets have to share one screen here, so each one is about a third of
   the width it was authored at — and a card that small has to be a smaller
   *drawing*, not the same paragraph set in 8px. So the blurb comes off the
   sheet and what is left is what a thrown card is for: what it is, what it was
   built with, and the fact that it opens.

   Only in the stage. Without `.is-stage` the board is a plain column with no
   height to fight over, and there the summary is the most useful line on the
   card — a reduced-motion reader keeps it. The case study keeps it either way;
   this is a cover, not the content.

   Everything else is already handled and is worth not re-solving: the sheet's
   type, padding and stitch inset are all `em` off `--w`, so they came down
   with the card on their own, and the fall is the same throw the desk gets. */
@media (max-width: 48rem) {
	.board.is-stage .card__desc {
		display: none;
	}

	/* The title takes the room the blurb gave up rather than the sheet keeping
	   it as air. `em`, like everything else in the stage card — a proportion
	   of the sheet, not a size. */
	.board.is-stage .card__title {
		font-size: 1.25em;
	}

	/* The sheet's own margin, cut. At the type floor the card no longer scales
	   but this padding still would, and 1em of a 10px sheet against a 175px
	   card is a fifth of it spent on air.

	   The thread is left to the `em` the block above sets it in, and that is
	   worth a line because it is not the same thing as "proportional". The
	   card's type has hit its floor by this width, so an `em` here is a little
	   more than the sheet's own scale would give — the true proportion of the
	   authored 3px on a card this size is about 1.4px, which is a hairline
	   rather than a stitch. Following the floored type instead keeps the
	   thread a thread. */
	.board.is-stage .card {
		gap: 0.5em;
		padding: calc(var(--stitch-inset) + var(--stitch-w) + 0.5em);
	}

	/* The table is the screen. Same negative-margin full bleed the Q&A room
	   uses in §2 and for the same reason — the gutters are 36px the cards can
	   have, and a card that falls off the side of the *screen* reads as having
	   been thrown, where one that stops short of an invisible line inside the
	   page reads as having been placed. `width: auto` because the board is a
	   stretched flex item: it takes the column's width and the margins push it
	   back out past the padding. `100vw` would count a scrollbar this column
	   does not have. */
	.board.is-stage {
		width: auto;
		margin-inline: calc(var(--gutter) * -1);
	}

	/* A phone has no hover, so the chrome around the table is only ever chrome:
	   trimmed to leave the cards the height. */
	.board-section.is-table > .wrap {
		padding-block: calc(3.75rem + var(--sp-3)) var(--sp-5);
	}

	.board-section.is-table .section-head {
		margin-block-end: var(--sp-4);
	}

	.board-section.is-table .board__foot {
		margin-block-start: var(--sp-4);
	}
}

/* --------------------------------------------------------------------------
   4. The shelf — the five little things

   A corner of the café wall rather than a dashboard: two columns of unequal
   width, each an ordinary stack, and no attempt to make the rows line up.
   Nothing here is a link, so the whole section is the one place on the page
   that is purely something to look at.

   Three rules keep it from reading as a grid of tiles:
   · every card carries its own --rest-rot, authored in the markup
   · the narrow column starts lower than the wide one
   · the drawings — record, book, cartridge — are different shapes, and two of
     them push past the edge of the paper they are pinned to
   -------------------------------------------------------------------------- */

.section--shelf {
	/* Tape, postmark and record all hang over the edge of their sheet, and a
	   sheet that is itself rotated puts a corner past the gutter on a phone.
	   `clip` rather than `hidden`, for the same reason the board uses it: a
	   scroll container here would take the sticky nav down with it. */
	overflow: clip;
}

/* One column by default, three when there is room for three. The stacks are
   real boxes at that width and nothing else — each is an ordinary flex column,
   and because the five cards are different heights the seams between the three
   never line up. That raggedness is the whole look, and it maintains itself:
   move a card from one stack to another in the HTML and the arrangement
   re-forms around it.

   Deliberately not `columns: <width>`. Multi-column flow would size and
   balance the stacks on its own, and briefly did — but every decoration here
   that hangs off the edge of a card is absolutely positioned, and Chromium
   fragments absolutely positioned boxes across column breaks. The postmark
   came out 312px wide instead of 84, painted across two columns, with a piece
   of tape loose in the gutter.

   Below the three-column width the stacks stop being layout and become
   grouping — which is exactly what `display: contents` removes. The cards
   become children of the one-column grid and read in source order, and the
   column is capped at a card's own width rather than stretched across a
   tablet: a 700px-wide sheet with two lines on it is mostly empty sheet. */
.shelf {
	display: grid;
	gap: var(--sp-6);
	max-width: 26rem;
	margin-inline: auto;
	/* The hover lift raises a card above its neighbours, and no further. */
	isolation: isolate;
}

.shelf__col {
	display: contents;
}

@media (min-width: 68rem) {
	.shelf {
		grid-template-columns: repeat(3, 1fr);
		gap: var(--sp-8);
		align-items: start;
		max-width: none;
	}

	.shelf__col {
		display: flex;
		flex-direction: column;
		gap: var(--sp-8);
	}

	/* The two authored offsets. Everything below them staggers on its own —
	   these only make sure the three stacks do not all start on the same
	   line, which is the one thing the cards' own heights cannot fix. */
	.shelf__col--b {
		margin-block-start: var(--sp-10);
	}

	.shelf__col--c {
		margin-block-start: var(--sp-4);
	}
}

/* ---- the sheet ---------------------------------------------------------- */

.knick {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--sp-3);

	/* A sheet of paper is not something a column break may happen inside. */
	break-inside: avoid;
	/* The row gap, in the only form multicol understands. */
	margin-block-end: var(--sp-8);

	/* Split across the two properties for the same reason the project cards
	   split theirs: the entrance owns opacity and scale, the pointer owns
	   translate and rotate, and neither can overwrite the other. */
	translate: 0 var(--hover-y, 0px);
	rotate: calc(var(--rest-rot, 0deg) * var(--rot-mult, 1));
	transition: translate var(--dur) var(--ease-spring),
		rotate var(--dur) var(--ease-spring);
}

/* The lift shadow is a pseudo whose opacity animates rather than a box-shadow
   on the card, which would re-rasterize the sheet and its text every frame.
   Nothing is obscured: a shadow with no spread paints outside the border box
   only. */
.knick::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: var(--shadow-lift);
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--dur) var(--ease-out);
}

/* Only where there is a pointer to hover with. These are not links and not
   focusable, so on a touch screen the hover state would be a thing that
   sticks after a tap and never leaves. */
@media (hover: hover) {
	.knick:hover {
		--hover-y: -5px;
		--rot-mult: 0.3; /* almost straightens, but keeps the hand-pinned feel */
		z-index: 3;
	}

	.knick:hover::after {
		opacity: 1;
	}
}

.knick__label {
	display: flex;
	align-items: center;
	gap: var(--sp-2);
	font-family: var(--ff-display);
	font-size: var(--fs-100);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	/* Mixed towards whatever it is sitting on. The fallback is the page, for
	   the three that are not sitting on anything — without it the whole
	   `color-mix` would be invalid and the label would fall back to inheriting
	   full-strength ink. */
	color: color-mix(in srgb, var(--ink) 62%, var(--card-bg, var(--bg-page)));
}

.knick__title {
	font-family: var(--ff-display);
	font-size: var(--fs-500);
	font-weight: 700;
	line-height: var(--lh-tight);
	letter-spacing: -0.02em;
}

.knick__sub {
	font-size: var(--fs-300);
	line-height: var(--lh-snug);
	color: var(--ink-soft);
}

/* The one link on the wall. Underlined at rest rather than on hover: it is
   sitting among five cards that are not links, so it has to say what it is
   before the pointer arrives. */
.knick__link {
	align-self: flex-start;
	font-family: var(--ff-display);
	font-size: var(--fs-200);
	font-weight: 600;
	color: var(--ink-soft);
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent);
	text-underline-offset: 3px;
	transition: color var(--dur) var(--ease-out),
		text-decoration-color var(--dur) var(--ease-out);
}

.knick__link:hover {
	color: var(--ink);
	text-decoration-color: currentColor;
}

.knick__note {
	font-size: var(--fs-200);
	line-height: var(--lh-snug);
	color: var(--ink-soft);
}

/* ---- the turntable ------------------------------------------------------ */

/* The record sits on top, centred, and the words sit under it — the same
   arrangement at every width, so the card does not rearrange itself halfway
   down the page. A sleeve on a shelf is looked at square on. */
.deck {
	display: flex;
	flex-direction: column;
	gap: var(--sp-4);
}

.deck__stack {
	position: relative;
	flex: none;
	/* The arm hangs off the top-right corner, so the box it is centred by is
	   wider than the record — the shift keeps the *record* on the card's
	   centre line rather than the box that happens to contain it. */
	width: 9rem;
	height: 9rem;
	margin-inline: auto;
}

.deck__stack img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	image-rendering: pixelated;
}

/* The two that are not playing, pushed out from under the one that is and
   turned a few degrees apart — a stack somebody has been through, not a
   stack somebody stacked. */
.deck__spare {
	width: 68%;
	height: 68%;
	opacity: 0.55;
}

.deck__spare--a {
	translate: -22% 30%;
	rotate: -12deg;
}

.deck__spare--b {
	translate: 34% -4%;
	rotate: 10deg;
}

.deck__disc {
	z-index: 1;
	animation: spin 5.5s linear infinite;
}

@keyframes spin {
	to {
		rotate: 1turn;
	}
}

/* The tone arm: a bar pivoting on a post at the top right, dropped onto the
   record. It needs all three pieces to read as an arm rather than as a line
   somebody left lying across the sleeve — the post it turns on, the arm, and
   the cartridge at the far end sitting in the groove. Square everything,
   because of what it is sitting next to. */
.deck__arm {
	position: absolute;
	z-index: 2;
	inset: 3% -7% auto auto;
	width: 5.6rem;
	height: 5px;
	background: var(--tan-deep);
	transform-origin: 100% 50%;
	rotate: -42deg;
	box-shadow: var(--sh-contact);
}

/* Both ends turn back the angle the arm was given. A child of a rotated box
   inherits its rotation, and a post standing on its corner reads as a diamond
   on a stick rather than as something the arm is mounted on. */
.deck__arm::before,
.deck__arm::after {
	content: "";
	position: absolute;
	rotate: 42deg;
}

/* The post, with a collar around it. */
.deck__arm::before {
	inset: -7px -9px auto auto;
	width: 19px;
	height: 19px;
	background: var(--tan-deep);
	box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--ink) 32%, var(--tan-deep)),
		var(--sh-contact);
}

/* The cartridge, hanging a little below the arm the way a real head does. */
.deck__arm::after {
	inset: -3px auto auto -5px;
	width: 13px;
	height: 11px;
	background: var(--ink);
}

.deck__now {
	display: flex;
	flex-direction: column;
	gap: var(--sp-1);
	min-width: 0;
}

.deck__now .chips {
	margin-block-start: var(--sp-2);
}

/* Four bars keeping time next to the label. Stepped rather than smooth: a
   level meter that slides is a modern one, and this café does not have a
   modern one. */
.eq {
	display: inline-flex;
	align-items: flex-end;
	gap: 2px;
	height: 0.8rem;
}

.eq i {
	width: 3px;
	height: 100%;
	background: var(--accent);
	transform-origin: 50% 100%;
	animation: eq-step 880ms steps(3, end) infinite alternate;
}

.eq i:nth-child(2) {
	animation-duration: 610ms;
}
.eq i:nth-child(3) {
	animation-duration: 1010ms;
}
.eq i:nth-child(4) {
	animation-duration: 740ms;
}

@keyframes eq-step {
	from {
		scale: 1 0.22;
	}
	to {
		scale: 1 1;
	}
}

/* ---- the book ----------------------------------------------------------- */

.book {
	display: flex;
	align-items: flex-start;
	gap: var(--sp-4);
}

/* Drawn, not photographed. A cover, a darker spine down one edge, two ruled
   lines where the title would be, and a ribbon coming out of the top. */
.book__cover {
	position: relative;
	flex: none;
	width: 4.5rem;
	height: 6.25rem;
	background: var(--peach-deep);
	box-shadow: var(--sh-contact), var(--sh-ambient);
	rotate: -4deg;
}

.book__cover::before,
.book__cover::after {
	content: "";
	position: absolute;
	height: 3px;
	background: rgb(255 255 255 / 0.55);
}

.book__cover::before {
	inset: 1.4rem 0.6rem auto 1.3rem;
}

.book__cover::after {
	inset: 2rem 1.3rem auto 1.3rem;
}

.book__spine {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0.55rem;
	background: color-mix(in srgb, var(--ink) 26%, var(--peach-deep));
}

.book__mark {
	position: absolute;
	inset: -0.55rem 0.9rem auto auto;
	width: 0.7rem;
	height: 2.9rem;
	background: var(--moss-deep);
	/* The swallowtail notch, cut out of the bottom end. */
	clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
}

.sprig {
	position: absolute;
	z-index: 2;
	inset: auto 2.25rem -1.35rem auto;
	width: 4rem;
	image-rendering: pixelated;
	rotate: 7deg;
	pointer-events: none;
}

.book__meta {
	display: flex;
	flex-direction: column;
	gap: var(--sp-1);
	min-width: 0;
}

/* ---- the passport ------------------------------------------------------- */

.knick--passport {
	gap: var(--sp-4);
}

/* The café stamps you in at the door, which is the joke. Rotated and slightly
   under-inked, like every real one. */
.postmark {
	position: absolute;
	z-index: 2;
	inset: -0.6rem 0.75rem auto auto;
	display: grid;
	place-content: center;
	gap: 1px;
	width: 5.25rem;
	height: 5.25rem;
	border: 2px dashed color-mix(in srgb, var(--peach-deep) 55%, var(--ink));
	border-radius: 50%;
	rotate: -13deg;
	background: color-mix(in srgb, var(--paper) 30%, transparent);
	font-family: var(--ff-display);
	font-size: 0.5rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-align: center;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--peach-deep) 30%, var(--ink));
	opacity: 0.85;
	pointer-events: none;
}

.postmark b {
	font-size: 0.75rem;
	letter-spacing: 0.06em;
}

.tally {
	display: flex;
	align-items: baseline;
	gap: var(--sp-2);
	font-size: var(--fs-300);
	color: var(--ink-soft);
}

.tally b {
	font-family: var(--ff-display);
	font-size: var(--fs-700);
	font-weight: 700;
	letter-spacing: -0.03em;
	color: var(--ink);
}


.stamps {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-2);
	/* Room for the corners the rotations throw out. */
	padding-block: 2px;
}

/* Each one is the stitch primitive at its smallest: a scrap of paper with a
   thread running just inside the edge. Square corners — a stamp is cut, not
   rounded. */
.stamp {
	--stitch-inset: 2px;
	--stitch-w: 2px;
	--r-card: 0px;
	--stitch-color: color-mix(in srgb, var(--paper) 80%, transparent);
	padding: 0.35rem 0.55rem;
	background: var(--paper-warm);
	box-shadow: var(--sh-contact);
	font-family: var(--ff-display);
	font-size: var(--fs-100);
	font-weight: 600;
	line-height: 1.1;
	white-space: nowrap;
	rotate: var(--rot, 0deg);
}

/* Three tints and three angles on a three-cycle, so the page never falls into
   a pattern you can read as one. */
.stamps li:nth-child(3n + 1) {
	--rot: -2.5deg;
	background: var(--moss);
}
.stamps li:nth-child(3n + 2) {
	--rot: 1.8deg;
	background: var(--butter);
}
.stamps li:nth-child(3n) {
	--rot: -1deg;
	background: var(--paper-warm);
}

/* ---- the clock ---------------------------------------------------------- */

/* A live time is the one thing on this wall that cannot be written down in
   advance, so it is also the one thing that leaves with the script. */
html:not(.js) .knick--clock {
	display: none;
}

/* A seven-segment panel in a plastic case. Two things make it read as one
   rather than as four numbers on a dark rectangle: the unlit segments are
   left faintly visible, and the case is lit from the top left — a lighter
   edge above, a darker one below. */
.led {
	--seg-w: clamp(1.5rem, 1.1rem + 1.4vw, 1.9rem);
	--seg-t: calc(var(--seg-w) * 0.2);
	--seg-on: #f4c04a;
	--seg-off: rgb(255 255 255 / 0.055);

	display: flex;
	align-items: center;
	gap: calc(var(--seg-w) * 0.28);
	align-self: flex-start;
	padding: calc(var(--seg-w) * 0.42) calc(var(--seg-w) * 0.5);
	background: #2b2f31;
	box-shadow: inset 0 0 0 3px #3c4143, inset 0 3px 0 4px rgb(255 255 255 / 0.07),
		var(--sh-contact), var(--sh-ambient);
}

.led__digit {
	position: relative;
	flex: none;
	width: var(--seg-w);
	height: calc(var(--seg-w) * 1.85);
}

/* Every bar is drawn; `.is-on` only changes its colour. The chamfered ends
   are what stop two segments meeting at a corner in a solid block. */
.seg {
	position: absolute;
	background: var(--seg-off);
	transition: background var(--dur-fast) linear;
}

.seg.is-on {
	background: var(--seg-on);
}

.seg--a,
.seg--d,
.seg--g {
	left: calc(var(--seg-t) * 0.62);
	right: calc(var(--seg-t) * 0.62);
	height: var(--seg-t);
	clip-path: polygon(
		0 50%,
		var(--seg-t) 0,
		calc(100% - var(--seg-t)) 0,
		100% 50%,
		calc(100% - var(--seg-t)) 100%,
		var(--seg-t) 100%
	);
}

.seg--a {
	top: 0;
}
.seg--g {
	top: calc(50% - var(--seg-t) / 2);
}
.seg--d {
	bottom: 0;
}

.seg--b,
.seg--c,
.seg--e,
.seg--f {
	width: var(--seg-t);
	height: calc(50% - var(--seg-t) * 1.1);
	clip-path: polygon(
		50% 0,
		100% var(--seg-t),
		100% calc(100% - var(--seg-t)),
		50% 100%,
		0 calc(100% - var(--seg-t)),
		0 var(--seg-t)
	);
}

.seg--f {
	top: calc(var(--seg-t) * 0.62);
	left: 0;
}
.seg--b {
	top: calc(var(--seg-t) * 0.62);
	right: 0;
}
.seg--e {
	bottom: calc(var(--seg-t) * 0.62);
	left: 0;
}
.seg--c {
	bottom: calc(var(--seg-t) * 0.62);
	right: 0;
}

.led__colon {
	display: flex;
	flex: none;
	flex-direction: column;
	justify-content: center;
	gap: calc(var(--seg-w) * 0.42);
	height: calc(var(--seg-w) * 1.85);
	margin-inline: calc(var(--seg-w) * 0.08);
}

.led__colon i {
	width: var(--seg-t);
	height: var(--seg-t);
	background: var(--seg-on);
	animation: led-blink 2s steps(1, end) infinite;
}

@keyframes led-blink {
	50% {
		background: var(--seg-off);
	}
}

/* ---- the DS ------------------------------------------------------------- */

/* An open clamshell, drawn in three stacked pieces: lid, hinge, deck.

   Two decisions carry the whole drawing. Both screens are 4:3 and the same
   width as each other, which is what makes a DS a DS — the same parts with a
   wide screen read as a generic handheld. And the shell is the site's own
   paper rather than console-grey, so the thing on the card still belongs to
   the café.

   Nothing else is drawn. No scanlines, no bezels, no button labels: at this
   size every one of them landed as noise, and the shape was doing the work
   on its own. */
.ds {
	/* Both screens take their width from here, so they can never drift apart
	   — and the console's proportions follow from one number. */
	--screen-w: 58%;
	--shell: color-mix(in srgb, var(--paper) 84%, var(--tan));
	--shell-dark: color-mix(in srgb, var(--tan) 70%, var(--ink));

	width: 100%;
	filter: drop-shadow(0 2px 4px rgb(88 70 52 / 0.24));
}

.ds__lid,
.ds__deck {
	background: var(--shell);
}

.ds__lid {
	display: flex;
	justify-content: center;
	padding: var(--sp-4);
	border-radius: 10px 10px 2px 2px;
}

/* The two barrels the lid turns on. Dark, because on a real one this is the
   one part that is always in shadow. */
.ds__hinge {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 0.55rem;
	padding-inline: 22%;
	background: var(--shell-dark);
}

.ds__hinge span {
	width: 1.4rem;
	height: 100%;
	background: color-mix(in srgb, var(--shell-dark) 62%, var(--ink));
}

.ds__deck {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-2);
	padding: var(--sp-4) var(--sp-3);
	border-radius: 2px 2px 10px 10px;
}

.ds__screen {
	flex: none;
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: var(--screen-w);
	aspect-ratio: 4 / 3;
	padding: var(--sp-2);
	background: var(--slate);
	color: var(--sage);
	text-align: center;
	box-shadow: var(--shadow-sunk);
	overflow: hidden;
}

.ds__title {
	font-family: var(--ff-display);
	font-size: var(--fs-400);
	font-weight: 700;
	line-height: var(--lh-tight);
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.ds__hours {
	font-size: var(--fs-100);
	line-height: var(--lh-snug);
	color: color-mix(in srgb, var(--sage) 74%, var(--slate));
}

/* Two bars crossing. One element, both pseudos, no image. */
.dpad {
	position: relative;
	flex: none;
	width: 2.1rem;
	height: 2.1rem;
}

.dpad::before,
.dpad::after {
	content: "";
	position: absolute;
	background: var(--shell-dark);
}

.dpad::before {
	inset: 0 34%;
}

.dpad::after {
	inset: 34% 0;
}

/* A, B, X, Y. A 2×2 grid turned on its corner is the diamond, and turning the
   grid rather than placing four dots by hand keeps the spacing even. */
.keys {
	flex: none;
	display: grid;
	grid-template-columns: repeat(2, auto);
	gap: 4px;
	rotate: 45deg;
	margin: 0.3rem;
}

.keys i {
	width: 0.62rem;
	height: 0.62rem;
	border-radius: var(--r-pill);
	background: var(--shell-dark);
}

/* ---- entrance ----------------------------------------------------------- */

/* Scoped to `.js`, like every other entrance on this page: with scripting off
   the five cards are simply on the wall.

   The four channels are written as one list with four delays so that the two
   the entrance owns can be staggered and the two the pointer owns cannot. A
   single `transition-delay` would have made hovering the last card wait
   320ms for the stagger it was given on the way in. */
.js .knick {
	opacity: 0;
	scale: 0.965;
	transition: opacity var(--dur) var(--ease-out),
		scale var(--dur-slow) var(--ease-spring),
		translate var(--dur) var(--ease-spring),
		rotate var(--dur) var(--ease-spring);
	transition-delay: var(--in-delay, 0ms), var(--in-delay, 0ms), 0s, 0s;
}

.js [data-shelf].is-in .knick {
	opacity: 1;
	scale: 1;
}

/* ---- the calm wall ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	/* Matches the specificity of the `.js` rule above so nothing is left
	   invisible waiting for a transition that will never run. */
	.js .knick,
	.knick {
		opacity: 1;
		scale: 1;
		--rest-rot: 0deg;
	}

	/* The record stops, the meter holds a level, and the colon stays lit.
	   All three would otherwise be snapped to their end state by the global
	   reduced-motion rule — which leaves the eq standing at full height like
	   a bar chart, and the colon stuck on the unlit half of its blink. */
	.deck__disc {
		animation: none !important;
	}

	.led__colon i {
		animation: none !important;
		background: var(--seg-on);
	}

	.eq i {
		animation: none !important;
		scale: 1 0.6;
	}

	.eq i:nth-child(2) {
		scale: 1 1;
	}
	.eq i:nth-child(3) {
		scale: 1 0.35;
	}
}
