/* Brand system, the Branding chapter of a case study. Standalone renderer: brand.js builds the markup from a brand JSON, this file styles it.
   Scoped under .kbrand. Reads the case page tokens (--kc-*) when it sits inside .kcase, and carries the same values as fallbacks.
   Chrome is strictly black, white and greys. Colour comes only from the work. Hover fill: orange #f0923a with dark ink.
   Layout numbers come from content-intake/REFERENCE-guidy-brand-layouts.md: gutter 8, radius 16 (8 inside a card), section step 120. */
.kbrand {
	--kb-font: var(--kc-font, 'Albert Sans', system-ui, -apple-system, 'Helvetica Neue', sans-serif);
	--kb-ease: var(--kc-ease, cubic-bezier(.2, .8, .2, 1));
	--kb-bg: var(--kc-bg, #F3F3F2); --kb-text: var(--kc-text, #141414); --kb-muted: var(--kc-muted, #585858);
	--kb-hair: var(--kc-hair, rgba(20, 20, 20, .22)); --kb-surface: var(--kc-surface, #FFFFFF);
	--kb-shadow: var(--kx-shadow, 0 1px 2px rgba(0, 0, 0, .08), 0 10px 20px -6px rgba(0, 0, 0, .12), 0 36px 56px -22px rgba(0, 0, 0, .22));
	--kb-tab: #E2E2E1;                 /* the browser bar ground of the favicon tile */
	--kb-hover: #f0923a;
	--kb-gut: 8px; --kb-rad: 16px; --kb-rad-in: 8px;
	--kb-sec: clamp(72px, 8.4vw, 120px); --kb-gap: clamp(24px, 2.8vw, 40px);
	color: var(--kb-text); font-family: var(--kb-font); font-size: 16px; line-height: 1.5;
}
[data-theme="ink"] .kbrand, .kbrand[data-theme="ink"] {
	--kb-bg: var(--kc-bg, #191919); --kb-text: var(--kc-text, #FFFFFF); --kb-muted: var(--kc-muted, #B4B4B4);
	--kb-hair: var(--kc-hair, rgba(255, 255, 255, .2)); --kb-surface: var(--kc-surface, #232323);
	--kb-shadow: var(--kx-shadow, 0 1px 2px rgba(0, 0, 0, .3), 0 10px 20px -6px rgba(0, 0, 0, .36), 0 36px 56px -22px rgba(0, 0, 0, .55));
	--kb-tab: #303030;
}
.kbrand *, .kbrand *::before, .kbrand *::after { box-sizing: border-box; }
.kbrand img, .kbrand svg { display: block; max-width: 100%; }
.kbrand button { font: inherit; color: inherit; }
.kbrand figure { margin: 0; }

/* intro: title left, text in the right half */
.kb-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.kb-eyebrow { margin: 0 0 18px; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--kb-muted); }
.kb-intro h2 { margin: 0; font-weight: 400; font-size: clamp(40px, 5.6vw, 80px); line-height: .98; letter-spacing: -.035em; }
.kb-intro p { margin: 0; max-width: 34em; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.42; letter-spacing: -.012em; }
.kb-intro p + p { margin-top: .7em; color: var(--kb-muted); }
.kb-intro p.kb-credit { margin-top: 1.2em; font-size: 14px; letter-spacing: .01em; color: var(--kb-muted); }

/* section: name left, count right, hairline, then the tiles */
.kb-sec { margin-top: var(--kb-sec); }
.kb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--kb-hair); margin-bottom: var(--kb-gap); }
.kb-head h3 { margin: 0; font-weight: 500; font-size: clamp(20px, 1.7vw, 24px); line-height: 1.1; letter-spacing: -.02em; }
.kb-head span { font-size: 16px; color: var(--kb-muted); white-space: nowrap; }
.kb-text { max-width: 34em; margin: 0 0 var(--kb-gap) 50%; font-size: 18px; line-height: 1.45; letter-spacing: -.01em; }
.kb-text p { margin: 0; } .kb-text p + p { margin-top: .6em; }
.kb-cap { margin: 14px 0 0; font-size: 14px; color: var(--kb-muted); letter-spacing: .01em; }
.kb-sub { margin: clamp(40px, 4.4vw, 64px) 0 16px; font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.kb-sub small { font-size: 14px; font-weight: 400; color: var(--kb-muted); margin-left: 10px; }

/* tiles */
.kb-tile { position: relative; border-radius: var(--kb-rad); overflow: hidden; box-shadow: inset 0 0 0 1px var(--kb-hair); background: var(--kb-surface); }
.kb-tl { position: absolute; left: 18px; bottom: 14px; right: 18px; font-size: 14px; line-height: 1.3; pointer-events: none; }
.kb-zoom { appearance: none; border: 0; padding: 0; margin: 0; background: none; display: block; width: 100%; height: 100%; cursor: zoom-in; border-radius: inherit; position: relative; }
.kb-zoom img { transition: transform .6s var(--kb-ease); }
.kb-zoom:focus-visible { outline: 2px solid var(--kb-text); outline-offset: 3px; }
@media (hover: hover) { .kb-zoom:hover img { transform: scale(1.015); } }

/* logo stage: rows of units. A wide logo takes two units, a square one takes one. */
.kb-rows { display: grid; gap: var(--kb-gut); }
.kb-row { display: grid; grid-template-columns: repeat(var(--u), minmax(0, 1fr)); gap: var(--kb-gut); }
.kb-lt { grid-column: span var(--w); aspect-ratio: var(--ar); }
/* A logo drawing is centred by its margins, never by a transform: the hover scale of .kb-zoom replaced a centring translate and threw the logo into the corner (Kait, 11 October 2026).
   Its box leaves 20 percent of the tile clear on each side or more, and a picture is contained in that box whatever the page says about img heights. */
.kb-art { position: absolute; inset: 0; margin: auto; width: var(--aw, 60%); height: var(--ah, 46%); }
.kbrand img.kb-art { width: var(--aw, 60%); height: var(--ah, 46%); max-width: none; max-height: none; object-fit: contain; object-position: 50% 50%; }
.kb-mask { -webkit-mask: var(--kb-src) center / contain no-repeat; mask: var(--kb-src) center / contain no-repeat; }
.kb-lt .kb-zoom { position: absolute; inset: 0; }
.kb-lt.sq { --aw: 46%; --ah: 46%; }
.kb-lt.display { --aw: 60%; --ah: 58%; }
/* favicon tile: a browser bar with the icon at its real size, then the files at their real sizes */
.kb-fav { background: var(--kb-tab); color: var(--kb-text); display: flex; flex-direction: column; }
.kb-fav-bar { display: flex; align-items: flex-end; gap: 4px; padding: 14px 14px 0; height: 54px; flex: none; }
.kb-fav-tab { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 12px; border-radius: 10px 10px 0 0; background: var(--kb-surface); font-size: 13px; white-space: nowrap; max-width: 78%; overflow: hidden; }
.kb-fav-tab img { width: 16px; height: 16px; flex: none; }
.kb-fav-tab span { overflow: hidden; text-overflow: ellipsis; }
.kb-fav-tab.ghost { background: none; color: var(--kb-muted); flex: 1; min-width: 0; }
.kb-fav-body { flex: 1; border-top: 1px solid var(--kb-hair); display: flex; align-items: flex-end; justify-content: center; gap: clamp(12px, 2vw, 28px); padding: 20px 14px 44px; flex-wrap: wrap; align-content: center; }
.kb-fav-body figure { display: grid; justify-items: center; gap: 10px; font-size: 13px; color: var(--kb-muted); }
.kb-fav-body img { image-rendering: auto; border-radius: 0; }
/* strips under the logo rows: smallest size, clear space */
.kb-strip { min-height: 168px; display: flex; align-items: center; justify-content: center; gap: 28px; padding: 56px 20px; flex-wrap: wrap; }
.kb-strip .kb-min { display: block; flex: none; }
.kb-strip i { width: 1px; height: 35px; background: currentColor; opacity: .35; }
/* The gap down equals the gap across, everywhere. `.kbrand figure { margin: 0 }` once outweighed the margin of these two, so a strip touched the row above it (Kait, 11 October 2026, Hoshii). */
.kbrand .kb-strip, .kbrand .kb-clear { margin-top: var(--kb-gut); }
/* construction tiles: a drawing with its guides, centred with the clear space of a logo tile */
.kb-lt.kb-ct { --aw: 56%; --ah: 52%; }
.kb-clear img { width: 100%; height: auto; }

/* colour */
.kb-grid { display: grid; gap: var(--kb-gut); grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.kb-sw { background: var(--kb-surface); border-radius: var(--kb-rad); padding: 8px 8px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kb-sw b { display: block; aspect-ratio: var(--sw-ar, 1 / 1); border-radius: var(--kb-rad-in); box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .28); }
.kb-sw h4 { margin: 6px 8px 0; font-size: 20px; font-weight: 500; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.kb-sw p { margin: 0 8px; font-size: 14px; color: var(--kb-muted); line-height: 1.35; }
.kb-sw dl { margin: 6px 8px 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 14px; line-height: 1.45; }
.kb-sw dt { color: var(--kb-muted); } .kb-sw dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kb-sw.small { --sw-ar: 3 / 2; } .kb-sw.small h4 { font-size: 16px; }
.kb-pair { aspect-ratio: 3 / 2; display: flex; flex-direction: column; justify-content: space-between; padding: 20px 22px; }
.kb-pair strong { font-weight: 400; font-size: clamp(40px, 5vw, 72px); line-height: 1; letter-spacing: -.03em; }
.kb-pair span { font-size: 14px; display: flex; justify-content: space-between; width: 100%; gap: 12px; }
.kb-bar { display: flex; height: clamp(72px, 9vw, 128px); border-radius: var(--kb-rad); overflow: hidden; box-shadow: inset 0 0 0 1px var(--kb-hair); }
.kb-bar i { display: block; min-width: 3px; }
.kb-legend { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 14px; }
.kb-legend li { display: flex; align-items: center; gap: 8px; }
.kb-legend b { width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .5); }
.kb-legend span { color: var(--kb-muted); font-variant-numeric: tabular-nums; }
.kb-strips { display: grid; gap: var(--kb-gut); }
.kb-steps { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); border-radius: var(--kb-rad); overflow: hidden; height: clamp(64px, 8vw, 112px); box-shadow: inset 0 0 0 1px var(--kb-hair); }
.kb-steps i { display: block; }
.kb-steplabels { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); font-size: 14px; color: var(--kb-muted); margin-top: 10px; }
.kb-steplabels span { padding-left: 2px; overflow-wrap: anywhere; }

/* type: one row per weight, set live in the real font (weight name left; capitals, lower case, figures and punctuation right) */
.kb-face + .kb-face { margin-top: clamp(40px, 4.6vw, 64px); }
.kb-facehead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 14px; font-size: 20px; letter-spacing: -.02em; }
.kb-facehead strong { font-weight: 500; }
.kb-facehead small { font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--kb-muted); }
.kb-facenote { margin: 0; font-size: 14px; color: var(--kb-muted); }
.kb-weights, .kb-scale { margin: 0; border-top: 1px solid var(--kb-hair); }
.kb-weights > div, .kb-scale > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 16px; align-items: baseline; padding: clamp(14px, 1.6vw, 22px) 0; border-bottom: 1px solid var(--kb-hair); }
.kb-weights dt, .kb-scale dt { font-size: 14px; line-height: 1.4; }
.kb-weights dt small, .kb-scale dt small { display: block; font-size: 14px; color: var(--kb-muted); font-variant-numeric: tabular-nums; }
.kb-weights dd { margin: 0; font-size: clamp(18px, 2.2vw, 30px); line-height: 1.32; overflow-wrap: anywhere; font-synthesis: none; }
.kb-weights dd span { display: inline-block; max-width: 100%; margin-right: .6em; overflow-wrap: anywhere; }
.kb-scale dd { margin: 0; overflow-wrap: anywhere; font-synthesis: none; }
.kb-scale { margin-top: 0; }
/* a commercial face: the specimen of her own guideline as outlines, painted in the text colour (no font file is on the site) */
.kbrand figure.kb-vspec { margin: 0; padding: clamp(20px, 4vw, 56px); background: var(--kb-surface); color: var(--kb-text); }
.kb-vspec .kb-mask { display: block; width: min(100%, 760px); -webkit-mask-position: left center; mask-position: left center; }
@media (max-width: 640px) { .kb-weights > div, .kb-scale > div { grid-template-columns: minmax(0, 1fr); gap: 6px; } .kb-weights dt small, .kb-scale dt small { display: inline; margin-left: 8px; } }

/* bento: graphic elements, illustration, applications, boards */
.kb-bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--kb-gut); }
.kb-bt { grid-column: span var(--span, 6); min-height: 0; }
.kb-bt.h-a { height: clamp(300px, 36vw, 520px); } .kb-bt.h-b { height: clamp(260px, 30vw, 440px); } .kb-bt.h-r { aspect-ratio: var(--ar); }
.kb-bt .kb-zoom { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; }
.kb-bt.board img, .kb-bt.photo img { width: 100%; height: 100%; object-fit: cover; }
.kb-bt.render .kb-zoom { padding: 5% 6%; }
.kb-bt.render img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .16)); }
.kb-bt.art .kb-zoom { padding: 6% 7%; }
.kb-bt.art img { width: 100%; height: 100%; object-fit: contain; }
.kb-bt.screen .kb-zoom { padding: clamp(18px, 3.4vw, 56px); }
.kb-bt.screen img { height: auto; max-height: 100%; width: auto; max-width: 100%; border-radius: clamp(6px, .8vw, 12px); box-shadow: var(--kb-shadow); }
.kb-icons { display: grid; grid-template-columns: repeat(var(--cols, 10), minmax(0, 1fr)); gap: var(--kb-gut); }
.kb-icon { aspect-ratio: 1 / 1; }
.kbrand figure.kb-construct { aspect-ratio: 3 / 1; margin: 0 0 var(--kb-gut); --aw: 26%; --ah: 78%; }
@media (max-width: 640px) { .kb-construct { aspect-ratio: 3 / 2; --aw: 56%; --ah: 76%; } }
.kb-icon .kb-art { --aw: 40%; --ah: 40%; }

/* illustration: every picture whole in its own ratio, never drawn above its natural width (content-intake/REBELS-ILLUSTRATIONS.md, layout notes 2 and 3) */
.kb-bento.natural { align-items: start; }
.kb-bento.natural .kb-bt { height: auto; aspect-ratio: auto; justify-self: center; width: 100%; max-width: var(--nw, none); }
.kb-bento.natural .kb-bt .kb-zoom { display: block; height: auto; }
.kb-bento.natural .kb-bt img { display: block; width: 100%; height: auto; aspect-ratio: var(--nar, auto); object-fit: contain; }
.kb-bt video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* own lightbox, used when no Studio host answers */
.kb-lb { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: transparent; color: #fff; font-family: var(--kb-font, 'Albert Sans', system-ui, sans-serif); }
.kb-lb::backdrop { background: rgba(10, 10, 10, .93); }
.kb-lb[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; place-items: center; }
.kb-lb-pic { width: 100%; height: 100%; min-height: 0; display: grid; place-items: center; padding: clamp(12px, 3vw, 48px) clamp(12px, 3vw, 48px) 8px; cursor: zoom-out; }
.kb-lb-pic img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 10px; }
.kb-lb-pic img.pad { padding: 4%; }
.kb-lb p { margin: 0; padding: 10px 64px 20px; font-size: 14px; color: #D0D0D0; text-align: center; }
.kb-lb button { position: fixed; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background-color .25s, color .25s; }
.kb-lb-x { top: 14px; right: 14px; } .kb-lb-p { left: 14px; bottom: 12px; } .kb-lb-n { right: 14px; bottom: 12px; }
.kb-lb button[hidden] { display: none; }
@media (hover: hover) { .kb-lb button:hover { background: #f0923a; color: #141414; } }
.kb-lb button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* reveal */
.kb-rv { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--kb-ease), transform .8s var(--kb-ease); }
.kb-rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .kb-rv { opacity: 1; transform: none; transition: none; } .kb-zoom img { transition: none; } }

/* small screens */
@media (max-width: 820px) {
	.kb-intro { grid-template-columns: 1fr; gap: 20px; }
	.kb-text { margin-left: 0; }
	.kb-row { grid-template-columns: 1fr 1fr; }
	.kb-lt { grid-column: span 2; aspect-ratio: 5 / 3; }
	.kb-lt.sq { grid-column: span 1; aspect-ratio: 1 / 1; }
	.kb-lt.kb-ct { grid-column: span 2; aspect-ratio: 5 / 3; }
	.kb-lt.sq.m-full { grid-column: span 2; aspect-ratio: 2 / 1; --aw: 30%; --ah: 56%; }
	.kb-lt.kb-fav { grid-column: span 2; aspect-ratio: auto; min-height: 230px; }
	.kb-lt.display { aspect-ratio: 4 / 3; --aw: 62%; }
	.kb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.kb-spec { grid-template-columns: 1fr; }
	.kb-scale > div { grid-template-columns: 1fr; gap: 6px; }
	.kb-pair { aspect-ratio: 1 / 1; padding: 14px; } .kb-pair span { flex-direction: column; gap: 0; }
	.kb-bt { grid-column: span 12; }
	.kb-bt.m-half { grid-column: span 6; }
	.kb-bt.h-a, .kb-bt.h-b { height: auto; aspect-ratio: 4 / 3; }
	.kb-bt.m-half.h-a, .kb-bt.m-half.h-b { aspect-ratio: 3 / 4; }
	.kb-icons { grid-template-columns: repeat(var(--mcols, 4), minmax(0, 1fr)); }
	.kb-strip { gap: 18px; }
}

/* Every tile carries its hairline ON TOP of its picture (Kait, 11 October 2026, Hoshii in Ink: dark boards on the dark ground read as holes).
   The inset shadow of .kb-tile lies under the picture and is covered by it; this one is drawn over it and takes no pointer. */
.kb-tile::after { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--kb-hair); pointer-events: none; }
