/* Theme: follow the OS, allow a page-level override via color-scheme. */

:root {
	color-scheme: light dark;
	--bg: light-dark(#F8F9FA, #1C1B1A);
	--fg: light-dark(#1A1918, #F2F0EE);
	--surface: light-dark(#F0F0F0, #2A2826);
	--icon-bg: light-dark(#F8F8F8, #2A2826);
	--accent: light-dark(#8E5852, #D4A39D);
	--accent-border: light-dark(rgba(142, 88, 82, 0.295), rgba(212, 163, 157, 0.4));
	--accent-hover: light-dark(rgba(142, 88, 82, 0.189), rgba(212, 163, 157, 0.22));
	--rule: light-dark(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.15));
}

html {
	background-color: var(--bg);
}

body {
	background: var(--bg) none;
	color: var(--fg);
}

div.home a {
	background: light-dark(rgba(184, 162, 162, 0.15), rgba(212, 163, 157, 0.18));
}

#support a:hover,
.privacy a:hover {
	background: var(--accent-hover) none;
}

ul.features-ios,
.definition {
	background: var(--surface);
}

.icon img, ul.sitenav li a, ul.sitenav {
	background: var(--icon-bg);
}
ul.sitenav li a, ul.sitenav {
	background: var(--bg);
}
ul.sitenav li a:hover {
	color: var(--accent)
}
ul.sitenav li.active a {
	background: var(--surface);
}
#support li,
.privacy li {
	border-top-color: var(--accent-border);
	color: var(--accent);
}

.copytext li {
	border-bottom-color: var(--rule);
}

.brand {
	position: relative;
}

.theme-toggle {
	position: absolute;
	top: 0.85rem;
	right: 0;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	padding: 0.45rem 0.85rem;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: var(--surface);
	color: var(--fg);
	cursor: pointer;
	font-size: 0.8125rem;
	line-height: 1;
}

.theme-toggle-track {
	display: inline-block;
	width: 1.75rem;
	height: 1rem;
	border-radius: 999px;
	background: var(--rule);
	position: relative;
	flex-shrink: 0;
}

.theme-toggle-thumb {
	position: absolute;
	top: 0.125rem;
	left: 0.125rem;
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 50%;
	background: var(--fg);
}

html[data-theme="dark"] .theme-toggle-thumb,
.theme-toggle[aria-checked="true"] .theme-toggle-thumb {
	left: auto;
	right: 0.125rem;
}

html[data-theme="dark"] .title img {
	filter: invert(1);
}

.app-dark {
	display: none;
}

html[data-theme="dark"] .app-light {
	display: none;
}

html[data-theme="dark"] .app-dark {
	display: block;
}
/*
.watch-clip-wrap {
	position: relative;
	z-index: 1;
	margin: -0.5rem 0 1.25rem 1rem;
}

.watch-clip {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin-left: -0.5rem;
	padding: 0.25rem 0.5rem;
	border-radius: 6px;
	color: var(--accent);
	text-underline-offset: 0.2em;
	transition: background-color 600ms;
}

.watch-clip:hover {
	background: var(--accent-hover);
}*/

.clip-dialog {
	position: fixed;
	inset: 0;
	padding: 1rem;
	border: none;
	background: transparent;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
}

.clip-dialog:not([open]) {
	display: none;
}

.clip-dialog[open] {
	display: grid;
	place-items: center;
	overflow: auto;
}

.clip-dialog::backdrop {
	background: light-dark(rgba(248, 249, 250, 0.86), rgba(28, 27, 26, 0.88));
	backdrop-filter: blur(10px);
}

.clip-sheet {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.75rem;
	width: min(22.5rem, 100%, calc((100dvh - 7rem) * 498 / 1080));
}

.clip-close {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0.45rem 0.85rem;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: var(--surface);
	color: var(--fg);
	cursor: pointer;
	font-size: 0.8125rem;
	line-height: 1;
}

.clip-frame {
	width: 100%;
	aspect-ratio: 498 / 1080;
	border-radius: 28px;
	overflow: hidden;
	background: var(--surface);
	box-shadow: 0 16px 40px light-dark(rgba(26, 25, 24, 0.12), rgba(0, 0, 0, 0.4));
}

.clip-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
	#support a:hover,
	.privacy a:hover,
	/*.watch-clip*/ {
		transition: none;
	}

	.clip-dialog::backdrop {
		backdrop-filter: none;
	}
}
