/*
 * The bento below the Mac (bento.js builds the tiles). Every tile is the popover's own
 * component in its tokens (.lv-kit, demo.css), at its real size; html.dark flips them.
 */

:root {
	--bt-tile: #FFFFFF;
	/* Each tile's soft wash, in the page's palette: blue, peach, sky, green, gold, rose, teal. */
	--bt-a: rgba(80, 130, 255, 0.30);
	--bt-p: rgba(255, 160, 100, 0.32);
	--bt-s: rgba(70, 175, 255, 0.28);
	--bt-g: rgba(48, 185, 95, 0.24);
	--bt-y: rgba(245, 185, 0, 0.27);
	--bt-r: rgba(255, 110, 150, 0.24);
	--bt-t: rgba(40, 195, 200, 0.28);
	--bt-tile-rim: rgba(0, 0, 0, 0.06);
	--bt-rise: cubic-bezier(.22, 1, .36, 1);
	--bt-frame-shadow: 0 0 0 1px rgba(0, 0, 0, 0.07), 0 12px 32px -16px rgba(0, 0, 0, 0.22);
}
html.dark {
	--bt-tile: #0F0F10;
	--bt-a: rgba(60, 110, 255, 0.32);
	--bt-p: rgba(245, 135, 70, 0.24);
	--bt-s: rgba(40, 150, 245, 0.30);
	--bt-g: rgba(40, 175, 90, 0.24);
	--bt-y: rgba(235, 170, 20, 0.22);
	--bt-r: rgba(240, 80, 130, 0.22);
	--bt-t: rgba(30, 175, 190, 0.26);
	--bt-tile-rim: rgba(255, 255, 255, 0.08);
	--bt-frame-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
}

.bento {
	display: block;
	padding: 120px 20px 0;
	text-align: left;
}

/* ------------------------------------------------------------ The grid */

.bt-grid {
	max-width: 1100px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: auto;
	gap: 16px;
	grid-template-areas:
		"automode automode automode automode"
		"disk    disk    gauges  gauges"
		"list    list    confirm confirm"
		"agents  agents  actions actions"
		"levels  levels  actions actions";
}
.bt-tile[data-tile="auto"] { grid-area: automode; }
.bt-tile[data-tile="disk"] { grid-area: disk; }
.bt-tile[data-tile="gauges"] { grid-area: gauges; }
.bt-tile[data-tile="list"] { grid-area: list; }
.bt-tile[data-tile="confirm"] { grid-area: confirm; }
.bt-tile[data-tile="agents"] { grid-area: agents; }
.bt-tile[data-tile="actions"] { grid-area: actions; }
.bt-tile[data-tile="levels"] { grid-area: levels; }
/* Before bento.js builds the tiles, the page's own markup stays out of sight. */
.bt-grid > :not(.bt-shot) { display: none; }

.bt-tile {
	position: relative;
	margin: 0;
	min-width: 0;
	overflow: hidden;
	border-radius: 26px;
	background: var(--bt-wash, none), var(--bt-tile);
	box-shadow: inset 0 0 0 1px var(--bt-tile-rim);
	isolation: isolate;
	display: flex;
	flex-direction: column;
}
.bt-tile[data-tile="auto"] { --bt-wash: radial-gradient(70% 90% at 0% 0%, var(--bt-a), transparent 70%), radial-gradient(60% 80% at 100% 100%, var(--bt-p), transparent 70%); }
.bt-tile[data-tile="disk"] { --bt-wash: radial-gradient(90% 90% at 100% 0%, var(--bt-g), transparent 70%), radial-gradient(70% 80% at 0% 100%, var(--bt-y), transparent 70%); }
.bt-tile[data-tile="gauges"] { --bt-wash: radial-gradient(90% 90% at 0% 0%, var(--bt-s), transparent 70%), radial-gradient(70% 80% at 100% 100%, var(--bt-t), transparent 70%); }
.bt-tile[data-tile="list"] { --bt-wash: radial-gradient(90% 90% at 100% 0%, var(--bt-p), transparent 70%), radial-gradient(70% 80% at 0% 100%, var(--bt-r), transparent 70%); }
.bt-tile[data-tile="confirm"] { --bt-wash: radial-gradient(90% 90% at 0% 0%, var(--bt-t), transparent 70%), radial-gradient(70% 80% at 100% 100%, var(--bt-g), transparent 70%); }
.bt-tile[data-tile="agents"] { --bt-wash: radial-gradient(90% 90% at 100% 0%, var(--bt-p), transparent 70%), radial-gradient(70% 80% at 0% 100%, var(--bt-s), transparent 70%); }
.bt-tile[data-tile="actions"] { --bt-wash: radial-gradient(90% 70% at 0% 0%, var(--bt-r), transparent 70%), radial-gradient(70% 60% at 100% 100%, var(--bt-a), transparent 70%); }
.bt-tile[data-tile="levels"] { --bt-wash: radial-gradient(90% 90% at 100% 0%, var(--bt-y), transparent 70%), radial-gradient(70% 80% at 0% 100%, var(--bt-s), transparent 70%); }
/* Under the component, at the bottom-leading corner, the same in every tile: a title and one line. */
.bt-cap { padding: 0 26px 24px; }
.bt-label {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 22px;
	color: var(--text);
}
.bt-sub { margin: 3px 0 0; font-size: 14px; line-height: 19px; color: var(--muted); }
/* Each tile sizes to its component, above its caption. */
.bt-stage {
	position: relative;
	flex: 1;
	min-height: 180px;
	box-sizing: border-box;
	padding: 32px 24px 28px;
	display: flex;
	justify-content: center;
	align-items: center;
	pointer-events: none;
}

/* The popover's components at their real size, in a frame like the popover's. */
.bt-kit { display: contents; }
.bt-pop {
	width: 360px;
	max-width: 100%;
	flex: none;
	border-radius: 16px;
	box-shadow: inset 0 0 0 1px var(--pop-rim), var(--bt-frame-shadow);
}
/* Nothing scrolls in a tile: every part keeps its full height, so the tile sizes to it. */
.bt-pop .lv-scroll, .bt-pop .lv-clist, .bt-pop .lv-bsheet { flex: none; min-height: auto; max-height: none; overflow: hidden; }
.bt-actions .lv-panel.lv-bsheet { position: absolute; }

/* The disk: tips walk its sections. */

.bt-disk .lv-disk { padding-bottom: 44px; }
.bt-disk .lv-tip { bottom: auto; top: calc(100% + 8px); }
.bt-disk .lv-tick { transition: background-color .15s, opacity .15s; }

/* The list: five rows of Ready to free. */
.bt-list .lv-scroll { padding: 8px 8px 10px; }

/* Confirm: the sheet on its own, in place. */
.bt-confirm { background: var(--pop-bg); }
.bt-sheet.lv-bsheet { position: relative; inset: auto; transform: none; border-radius: 16px; box-shadow: none; }

/* Keyboard first: the actions sheet rises over the dimmed popover. */
.bt-actions { display: flex; flex-direction: column; overflow: hidden; }
.bt-actions .lv-actions { flex: none; }
.bt-scrim { position: absolute; inset: 0; z-index: 9; background: rgba(0, 0, 0, 0.16); opacity: 0; transition: opacity .3s; }
html.dark .bt-scrim { background: rgba(0, 0, 0, 0.35); }
.bt-panel.lv-bsheet { transition: transform .55s var(--bt-rise); }
.is-open .bt-scrim { opacity: 1; }
.is-open .bt-panel.lv-bsheet { transform: none; }
.bt-panel .lv-psearch-ph { display: block; padding: 10px 16px 12px; color: rgb(var(--fg) / 0.4); }

/* The cleanup levels and what each frees. */
.bt-levels { width: auto; padding: 20px 20px 18px; }
.bt-levels-in { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.bt-levels .lv-seg button { transition: background-color .2s, color .2s; }

/* The agents: cards, one chosen. */
.bt-agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 520px; }
.bt-agent { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; border-radius: 14px; background: var(--pop-bg); box-shadow: inset 0 0 0 1px var(--pop-rim); transition: box-shadow .25s; }
.bt-agent-t { display: flex; flex-direction: column; min-width: 0; }
.bt-agent-t b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-agent-t small { font-size: 11px; color: rgb(var(--fg) / 0.55); white-space: nowrap; }
.bt-agent-r { position: absolute; top: 6px; right: 6px; color: var(--accent); opacity: 0; transition: opacity .25s; }
.bt-agent.is-on { box-shadow: inset 0 0 0 2px var(--accent); }
.bt-agent.is-on .bt-agent-r { opacity: 1; }

/* Arrival: levo.css's, as cntxtlabs.co's (levo.js's LevoArrive). */

/* Resetting a tile between plays: no transitions. */
.bt-still, .bt-still * { transition: none !important; animation: none !important; }

/* ------------------------------------------------------------ Auto mode */

.bt-auto { gap: 32px; align-items: stretch; }
.bt-auto-card { flex: none; }
.bt-auto-pop { width: 360px; }
.bt-auto .lv-disk { padding-bottom: 10px; }
.bt-auto .lv-tick { transition: background-color .35s ease; }
.bt-auto .lv-tick.is-data { background-color: #FF3B30; }
.bt-auto .lv-tick.is-sys { background-color: #F2B800; }
.bt-auto .lv-tick.is-apps { background-color: #FF9500; }
html.dark .bt-auto .lv-tick.is-data { background-color: #FF453A; }
html.dark .bt-auto .lv-tick.is-sys { background-color: #FFD60A; }
html.dark .bt-auto .lv-tick.is-apps { background-color: #FF9F0A; }
.bt-auto .lv-tick.is-ready { background-color: var(--lv-ready); }
.bt-auto .lv-tick.is-free { background-color: var(--lv-free); }
html.dark .bt-auto .lv-tick.is-free { background-color: rgb(var(--fg) / 0.14); }
.bt-auto-day { margin-top: 8px; display: flex; justify-content: flex-end; font-size: 12px; font-weight: 500; color: rgb(var(--fg) / 0.5); font-variant-numeric: tabular-nums; }

/* A slice of the Mac's screen: the wallpaper, Levo in the menubar, and the notification arriving. */
.bt-auto-screen {
	--glass-lit: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 0 0 0.5px rgba(255, 255, 255, 0.5);
	position: relative;
	flex: 1;
	min-width: 0;
	align-self: stretch;
	border-radius: 16px;
	overflow: hidden;
	background:
		radial-gradient(60% 80% at 85% 10%, rgba(255, 196, 160, 0.9), rgba(255, 196, 160, 0) 70%),
		radial-gradient(70% 90% at 10% 100%, rgba(150, 190, 255, 0.9), rgba(150, 190, 255, 0) 70%),
		linear-gradient(160deg, #E9EDF7, #F4EAE6);
	box-shadow: inset 0 0 0 1px var(--bt-tile-rim);
}
html.dark .bt-auto-screen {
	--glass-lit: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 0.5px rgba(255, 255, 255, 0.1);
	background:
		radial-gradient(60% 80% at 80% 10%, rgba(36, 84, 196, 0.75), rgba(36, 84, 196, 0) 70%),
		radial-gradient(70% 90% at 10% 100%, rgba(30, 90, 160, 0.7), rgba(30, 90, 160, 0) 70%),
		linear-gradient(160deg, #0A0E1A, #0B1220);
}
.bt-auto-screen { container-type: inline-size; }
.bt-auto-menubar { position: absolute; top: 0; left: 0; right: 0; height: 26px; padding: 0 12px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255, 255, 255, 0.32); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); font-size: 12px; color: #000; white-space: nowrap; }
html.dark .bt-auto-menubar { background: rgba(0, 0, 0, 0.22); color: #fff; }
.bt-mb-l, .bt-mb-r { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bt-mb-l b { font-weight: 700; }
.bt-mb-apple .lv-sym, .bt-mb-r .lv-sym { display: block; }
.bt-mb-apple .lv-sym { margin-top: -2px; }
.bt-mb-levo { display: inline-flex; align-items: center; gap: 5px; }
.bt-auto-menubar b.bt-roll { font-weight: 600; }
/* Rolling digits, as the app's numeric text: the changed ones slide and fade through. */
.bt-roll { display: inline-flex; font-variant-numeric: tabular-nums; }
.bt-rd { position: relative; display: inline-block; }
.bt-rd i { display: inline-block; font-style: normal; }
.bt-rd i.is-out { position: absolute; left: 0; top: 0; animation: bt-rd-out .38s cubic-bezier(.3, .7, .4, 1) forwards; }
.bt-rd i.is-in { animation: bt-rd-in .38s cubic-bezier(.3, .7, .4, 1) both; }
@keyframes bt-rd-out { to { transform: translateY(var(--dy)); opacity: 0; filter: blur(2px); } }
@keyframes bt-rd-in { from { transform: translateY(calc(var(--dy) * -1)); opacity: 0; filter: blur(2px); } }
/* Narrower slices keep the right side whole and drop menu titles from the end. */
@container (max-width: 600px) { .bt-mb-menu:nth-of-type(n + 4) { display: none; } }
@container (max-width: 470px) { .bt-mb-menu { display: none; } }
@container (max-width: 330px) { .bt-mb-clock { display: none; } }
.bt-auto-m { display: block; width: 17px; height: 10.87px; overflow: visible; }
.bt-auto-m path { fill: currentColor; }
.bt-auto-note.lv-note { width: min(344px, calc(100% - 24px)); top: 40px; right: 12px; }

/* ------------------------------------------------------------ Phones: one column of full-width cards */

@media (max-width: 1020px) {
	.bt-auto { flex-direction: column; gap: 18px; align-items: center; }
	.bt-auto-screen { flex: none; width: 100%; min-height: 140px; }
}
@media (max-width: 760px) {
	.bento { padding: 64px 20px 0; }
	.bt-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; grid-template-rows: none; grid-auto-rows: auto; gap: 12px; }
	.bt-grid > .bt-tile { grid-area: auto; }
	.bt-tile { border-radius: 24px; }
	.bt-cap { padding: 0 20px 20px; }
	.bt-stage { min-height: 0; padding: 20px 12px 18px; }
	.bt-pop, .bt-auto-pop, .bt-auto-card { width: 100%; max-width: 360px; }
	.bt-agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
	/* Every tile shows its end state. */
	.bt-panel.lv-bsheet { transition: none; }
}

/* The grid's built height, kept while bento.js (loaded on idle, see levo.js) builds it, so nothing
   below it moves (measured: 1643 px from 1021 px wide, 1801 to 1020, 2744 on phones). */
.bt-grid:empty { min-height: 2744px; }
@media (min-width: 761px) { .bt-grid:empty { min-height: 1801px; } }
@media (min-width: 1021px) { .bt-grid:empty { min-height: 1643px; } }
