/* Laurel component styles. Load after tokens.css. Put class="laurel" on your app root. Every value is a token, or
   a literal copied from cubby where the token set has no step for it. */

:root {
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--ease-io: cubic-bezier(0.65, 0, 0.35, 1);
	--snap: cubic-bezier(0.32, 0.72, 0, 1);
}

:where(.laurel),
:where(.laurel) button,
:where(.laurel) input {
	font-family: var(--font-sans);
	font-weight: 400;
}
:where(.laurel) {
	color: var(--ink);
	box-sizing: border-box;
}
:where(.laurel) *,
:where(.laurel) *::before,
:where(.laurel) *::after {
	box-sizing: border-box;
}
:where(.laurel) button {
	font-size: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}
.laurel button:focus-visible {
	outline: 2px solid var(--ink-2);
	outline-offset: 2px;
}
.laurel svg.icon {
	display: block;
	fill: currentColor;
	flex-shrink: 0;
}

/* ---------- buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 32px;
	padding: 0 14px;
	border-radius: var(--radius-md);
	font-size: 13px;
	white-space: nowrap;
	text-decoration: none;
	transition: background 0.15s, color 0.15s, transform 0.12s;
}
.btn:active {
	transform: scale(0.97);
}
.btn--solid {
	background: var(--ink);
	color: var(--surface);
}
.btn--solid:hover {
	background: var(--ink-hover);
}
.btn--ghost {
	color: var(--ink-2);
	box-shadow: inset 0 0 0 1px var(--line-2);
}
.btn--ghost:hover {
	background: var(--hover);
}
.btn--present {
	height: 34px;
	padding: 0 14px 0 12px;
	font-size: 13.5px;
	color: var(--ink);
	box-shadow: inset 0 0 0 1px var(--line-2);
}
.btn--present:hover {
	background: var(--hover);
}
.btn--quiet {
	gap: 8px;
	height: 28px;
	padding: 0 8px;
	border-radius: var(--radius-sm);
	font-size: 12.5px;
	color: var(--muted);
}
.btn--quiet:hover,
.btn--quiet.is-open {
	color: var(--ink-2);
	background: var(--hover);
}

.ibtn {
	width: 34px;
	height: 34px;
	display: inline-grid;
	place-items: center;
	border-radius: var(--radius-md);
	color: var(--ink-2);
	transition: background 0.15s, color 0.15s, transform 0.12s;
}
.ibtn:hover {
	background: var(--hover);
	color: var(--ink);
}
.ibtn:active {
	transform: scale(0.94);
}
.ibtn.is-active {
	background: var(--active);
	color: var(--ink);
}
.ibtn--sm {
	width: 22px;
	height: 22px;
	border-radius: var(--radius-xs);
}
.ibtn--faint {
	color: var(--faint);
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}
.chip {
	padding: 3px 9px;
	border-radius: var(--radius-pill);
	font-size: 13px;
	color: var(--ink);
	background: var(--white);
	box-shadow: inset 0 0 0 1px var(--line-2);
	transition: background 0.12s;
}
.chip:hover {
	background: var(--active);
}
.chip.is-strong {
	box-shadow: inset 0 0 0 1px var(--ink-2);
}

/* ---------- inline input ---------- */

.field {
	height: 28px;
	padding: 0 8px;
	border: 0;
	outline: 0;
	border-radius: var(--radius-sm);
	background: var(--white);
	box-shadow: var(--shadow);
	color: var(--ink);
	font-size: 14px;
}
.field::placeholder {
	color: var(--faint);
}

/* ---------- menus ---------- */

.menu {
	min-width: 210px;
	max-width: 320px;
	padding: 6px;
	background: var(--panel);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	font-size: 13.5px;
	color: var(--ink);
	animation: laurel-pop 0.16s var(--ease);
}
.menu__label {
	padding: 8px 10px 4px;
	font-size: 11.5px;
	color: var(--muted);
}
.mi {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	min-height: 32px;
	padding: 6px 10px;
	border-radius: var(--radius-sm);
	text-align: left;
	transition: background 0.12s;
}
.mi > span:first-child {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	white-space: nowrap;
}
.mi:hover:not(:disabled) {
	background: var(--hover);
}
.mi.is-active {
	background: var(--active);
}
.mi:disabled {
	opacity: 0.4;
	cursor: default;
}
.mi.is-danger {
	color: var(--danger);
}
.mi__hint {
	font-size: 11.5px;
	color: var(--muted);
	flex-shrink: 0;
}
.mi__icon {
	color: var(--ink-2);
}
.divider {
	height: 1px;
	margin: 5px 8px;
	background: var(--line);
}
@keyframes laurel-pop {
	from {
		opacity: 0;
		transform: scale(0.97) translateY(2px);
	}
}

/* ---------- toast ---------- */

.toast {
	display: inline-block;
	max-width: 440px;
	padding: 10px 14px;
	border-radius: 11px;
	background: var(--ink);
	color: var(--surface);
	font-size: 13px;
	line-height: 1.4;
	box-shadow: var(--shadow-lg);
	animation: laurel-toast 0.22s var(--ease) both;
}
@keyframes laurel-toast {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
}

/* ---------- floating toolbar ---------- */

.toolbar {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 5px;
	background: var(--panel-glass);
	backdrop-filter: blur(18px) saturate(1.4);
	-webkit-backdrop-filter: blur(18px) saturate(1.4);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow);
}
.toolbar .ibtn {
	width: 38px;
	height: 38px;
	border-radius: 10px;
}
.toolbar__sep {
	width: 1px;
	height: 18px;
	margin: 0 5px;
	background: var(--line-2);
}

/* ---------- sidebar: brand, project, chapters ---------- */

.sidebar {
	display: flex;
	flex-direction: column;
	background: var(--paper);
	padding: 16px 14px 18px 24px;
}
.sidebar__head {
	display: flex;
	align-items: flex-start;
	gap: 6px;
}
.sidebar__brand {
	flex: 1;
	font-size: 15px;
	line-height: 1.35;
	padding-top: 5px;
}
.chapters {
	list-style: none;
	margin: 32px 0 0;
	padding: 0;
	display: grid;
	gap: 10px;
}
.chapter__name {
	font-size: 20px;
	line-height: 1.2;
	text-align: left;
	text-wrap: pretty;
	color: var(--faint);
	transition: color 0.18s;
}
.chapter__name:hover,
.chapter.is-active .chapter__name {
	color: var(--ink);
}
/* the items under the current chapter hang off one hairline */
.sublist {
	list-style: none;
	margin: 8px 0 14px 1px;
	padding: 0 0 0 12px;
	border-left: 1px solid var(--line);
	font-size: 13px;
}
.sublist li {
	position: relative;
	height: 26px;
	display: flex;
	align-items: center;
}
.sublist button {
	color: var(--faint);
	transition: color 0.15s;
}
.sublist button:hover {
	color: var(--ink-2);
}
.sublist li.is-active button {
	color: var(--ink);
}
.sublist li.is-active::before {
	content: '';
	position: absolute;
	left: -13px;
	top: 6px;
	bottom: 6px;
	width: 1px;
	background: var(--ink);
}

/* ---------- floating window ---------- */

.window {
	display: flex;
	flex-direction: column;
	background: var(--white);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-window);
}
.window__bar {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 30px;
	flex-shrink: 0;
	padding: 0 8px 0 11px;
	background: var(--panel);
	border-bottom: 1px solid var(--line);
}
.window__dots {
	display: inline-flex;
	gap: 6px;
}
.window__dots i {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--line-2);
}
.window__title {
	position: absolute;
	left: 80px;
	right: 80px;
	text-align: center;
	font-size: 12px;
	color: var(--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.window__body {
	position: relative;
	flex: 1;
	min-height: 0;
	background: var(--surface);
}

/* a window that imitates a real macOS app (Photo Booth) */
.window--mac {
	font-family: var(--font-system);
	background: var(--mac-chrome);
	box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.22), 0 24px 60px -18px rgba(0, 0, 0, 0.4), 0 6px 16px -6px rgba(0, 0, 0, 0.18);
}
.window--mac .window__bar {
	height: 36px;
	padding: 0 14px;
	gap: 0;
	background: var(--white);
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.window--mac .window__dots {
	gap: 8px;
}
.window--mac .window__dots i {
	width: 13px;
	height: 13px;
	box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}
.window--mac .window__dots i:nth-child(1) {
	background: var(--mac-close);
}
.window--mac .window__dots i:nth-child(2) {
	background: var(--mac-minimize);
}
.window--mac .window__dots i:nth-child(3) {
	background: var(--mac-zoom);
}
.window--mac .window__title {
	position: static;
	margin-left: 22px;
	text-align: left;
	color: #4b4b4b;
	font-size: 15px;
	font-weight: 600;
}
.window--mac .window__body {
	background: var(--mac-chrome);
}
.booth__view {
	flex: 1;
	min-height: 0;
	background: #2b2b22;
}
.booth__controls {
	height: 62px;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
	padding: 0 20px;
	background: var(--mac-chrome);
}
.booth__seg {
	justify-self: start;
	display: flex;
	border-radius: 7px;
	background: rgba(0, 0, 0, 0.07);
}
.booth__seg button {
	width: 30px;
	height: 24px;
	display: grid;
	place-items: center;
	border-radius: var(--radius-xs);
	color: #3c3c3c;
}
.booth__seg button.is-active {
	background: var(--mac-select);
	color: var(--white);
}
.booth__shutter {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--shutter);
	color: var(--white);
	box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.28), 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}
.booth__effects {
	justify-self: end;
	width: 96px;
	height: 24px;
	border-radius: var(--radius-xs);
	background: rgba(0, 0, 0, 0.07);
	color: #2e2e2e;
	font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
	.menu,
	.toast {
		animation: none;
	}
}
