/* The glowcap mark as the documentation site draws it in masks, and the
   logotype lockup the site and rooms share. Rooms draws its mark with a
   shader (ui/mark/live.ts) and takes only the lockup from
   here. This drawing is what a browser with no device to run that shader on
   gets instead, and it is the same mushroom because it was traced from it. */

/* The still mark is four flat tones stacked back to front, each a mask in
   ui/tokens.css painted its own themed colour here. It stands where the shader
   does not run, so it carries no play of its own beyond a bloom under the
   pointer. The light and its beats belong to the shader. */
.icon-mark {
	position: relative;
	display: block;
	flex: none;
	overflow: visible;
	/* Colour belongs to the mark, and it is the colour of the light. In dark
	   that light is teal and the mushroom glows teal from inside its amber
	   rim, the brand's two colours in one object. In light it burns out to
	   white, because nothing teal is brighter than cream. `--mark-light`
	   carries that. A wrapping control stays a neutral toggle: hover and held
	   state are the button's. */
	color: var(--mark-light);
	/* The bloom is a drop-shadow on the lockup, not a piece. `filter: none`
	   does not interpolate with a drop-shadow list, so the off stack is the
	   same four shadows at zero mix and the light can fade in and out rather
	   than snap. */
	--mark-bloom-off:
		drop-shadow(0 0 6px color-mix(in srgb, var(--mark-light) 0%, transparent))
		drop-shadow(0 0 20px color-mix(in srgb, var(--mark-light) 0%, transparent))
		drop-shadow(0 0 46px color-mix(in srgb, var(--mark-light) 0%, transparent))
		drop-shadow(0 -14px 40px color-mix(in srgb, var(--mark-light) 0%, transparent));
	/* Four rings rather than three, because the fill closed the drawing's
	   holes and the halo now has an edge to sit outside instead of light
	   leaking through the middle. The rings reach far and stay thin, and that
	   pairing is the whole point: this is the air the mushroom is lighting,
	   so it has to be seen and it has to stay behind the light itself. Denser
	   rings read as a solid aura and swallow it. Each ring blurs the ring
	   before it, so the stack is thicker than any one number here suggests,
	   and lowering them together is what buys the reach. */
	--mark-bloom:
		drop-shadow(0 0 6px color-mix(in srgb, var(--mark-light) 42%, transparent))
		drop-shadow(0 0 20px color-mix(in srgb, var(--mark-light) 26%, transparent))
		drop-shadow(0 0 46px color-mix(in srgb, var(--mark-light) 17%, transparent))
		drop-shadow(0 -14px 40px color-mix(in srgb, var(--mark-light) 14%, transparent));
	filter: var(--mark-bloom-off);
	transition: filter 260ms ease;
}

/* Every piece is the same box in the same place, so the four masks register.
   The drawing is wider than tall and stands larger than the box it is given,
   the way the shader's canvas does: `GROW` in mark/live.ts opens the
   shader's frame by a fifth about the box's centre, and these four numbers are
   that same frame in percentages. They move together with `GROW` and with the
   traced frame, or not at all. Getting them right is what lets the still mark
   and the shader mark stand in for each other without the lockup shifting. */
.mark-piece {
	position: absolute;
	/* GENERATED by `zig build gen-mark`: the drawing's share of a 24-unit
	   box, grown the way the shader grows it. */
	left: -16.5%;
	top: 8%;
	width: 117.5%;
	height: 98.5%;
	/* END GENERATED */
	/* The piece box is the mask's own frame, so the mask stretches to it
	   exactly rather than being fitted inside a box it does not match. */
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}

/* Back to front. Each piece carries its whole layer rather than a ring,
   because each paints over the one before it instead of filling a hole left
   for it. The tones are the theme's: the shader keeps one mushroom and lights
   it differently, so on cream the flesh and rim come up warm and open while
   the windows stay as dark as they are at night, being holes. */
.mark-rim {
	-webkit-mask-image: var(--mark-silhouette);
	mask-image: var(--mark-silhouette);
	background: var(--mark-rim);
}
.mark-flesh {
	-webkit-mask-image: var(--mark-flesh);
	mask-image: var(--mark-flesh);
	background: var(--mark-body);
}
.mark-shade {
	-webkit-mask-image: var(--mark-shade);
	mask-image: var(--mark-shade);
	background: var(--mark-shadow);
}
.mark-windows {
	-webkit-mask-image: var(--mark-windows);
	mask-image: var(--mark-windows);
	background: var(--mark-window);
}

/* The mark as one glyph among others: rooms' two mark buttons. It paints the
   line drawing from ui/tokens.css through a mask over `currentColor`, which is
   the same thing the stroked glyphs beside it do, so it takes the control's
   colour in every state the control has and cannot drift out of step with the
   row. The mask is fitted inside the glyph's square box, which letterboxes a
   drawing wider than it is tall. That is wanted, since the box the row agrees
   on is the row's, not the mushroom's. */
.mark-glyph {
	display: block;
	flex: none;
	background: currentColor;
	-webkit-mask: var(--mark-line) center / contain no-repeat;
	mask: var(--mark-line) center / contain no-repeat;
}

/* The play the still mark can carry. The parent is whoever directly wraps
   `.icon-mark`: the site's header and footer lockups. Pointer surfaces only,
   because touch sticks :hover and a mark that lit on first tap and stayed lit
   is not a play. */
@media (hover: hover) {
	:has(> .icon-mark):hover .icon-mark {
		filter: var(--mark-bloom);
	}
}
@media (prefers-reduced-motion: reduce) {
	.icon-mark {
		transition: none;
	}
}

/* The logotype lockup: "glowcap" and an optional small-caps product name, one
   drawn unit. Every metric here is a fixed pixel. Borrowing
   the global type ramp would let each ramp tweak silently knock the caps off
   glowcap's lowercase body. A logotype is not typography. It is
   a drawing whose parts may never move relative to each other. Colours stay
   tokens so the lockup themes. Sizes, gaps, and the optical lift do not.
   The caps size is tuned against the title's x-height band by eye and pinned
   by the rooms browser proof. Rooms' rail and boot screen, and the site
   header, take the class. A new home does too, never a copy of these numbers. */
.wordmark {
	display: flex;
	align-items: baseline;
	justify-content: center;
	min-width: 0;
	font-weight: 800;
	/* The lockup's own drawing, not a step on the chrome ramp: this file's
	   opening line is that a logotype is not typography, and these two sizes
	   are the proportion the mark was drawn at. They move together with the
	   tracking and the letterfit below, or not at all. */
	font-size: 17px;
	letter-spacing: -.17px;
	line-height: 0;
	/* Not a spacing step: this is the lockup's own letterfit, measured against
	   the wordmark at this size the way its tracking was, and it moves when the
	   type does rather than when the layout does. */
	gap: 4.8px;
	color: var(--ink);
}
.wordmark span,
.wordmark small {
	line-height: 1;
}
.wordmark small {
	font-weight: 600;
	/* The other half of the lockup's drawing, sized against the logotype above
	   rather than against the chrome ramp. */
	font-size: 13px;
	letter-spacing: 1.56px;
	text-transform: uppercase;
	color: var(--accent-ink);
	/* Baseline-true: the caps share glowcap's baseline, feet level, the
	   classic logotype seat. Every lifted variant, centred on the x-height
	   band, then a half pixel under it, still read as floating. */
}
