:root {
	color-scheme: light dark;
	--bg: #fff8f0;
	--surface: #ffffff;
	--text: #1f1a2e;
	--muted: #5a5470;
	--border: #d9d2e6;
	--accent: #6b2fd6;
	--on-accent: #ffffff;
	--yes: #1b7a3d;
	--no: #b3261e;
	--none: #4f4966;
	--on-vote: #ffffff;
	--focus: #c25e00;
	--shadow: 0 2px 10px rgb(31 26 46 / 0.08);
	--radius: 16px;
	--page-width: 44rem;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #17131f;
		--surface: #221c2e;
		--text: #f4f0fa;
		--muted: #c2bad1;
		--border: #3d3450;
		--accent: #b79bff;
		--on-accent: #17131f;
		--yes: #6fdc95;
		--no: #ff8f86;
		--none: #c2bad1;
		--on-vote: #17131f;
		--focus: #ffb35c;
		--shadow: none;
	}
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
}

a {
	color: var(--accent);
}

:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 3px;
}

[tabindex="-1"]:focus {
	outline: none;
}

.skip-link {
	position: absolute;
	left: -999px;
	top: 1rem;
	background: var(--surface);
	padding: 0.5rem 1rem;
	border-radius: 8px;
}

.skip-link:focus {
	left: 1rem;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.site-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	max-width: var(--page-width);
	margin: 0 auto;
	padding: 1rem;
}

.brand {
	font-size: 1.25rem;
	font-weight: 800;
	text-decoration: none;
}

.greeting {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

main {
	max-width: var(--page-width);
	margin: 0 auto;
	padding: 0 1rem 4rem;
}

h1 {
	font-size: clamp(2rem, 7vw, 3rem);
	line-height: 1.1;
	margin: 1rem 0;
}

h2 {
	margin: 0 0 0.75rem;
}

.intro p,
.lead {
	font-size: 1.15rem;
}

.intro p:last-child {
	color: var(--muted);
	font-style: italic;
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 1.25rem;
	margin: 1.5rem 0;
}

button,
.button {
	font: inherit;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	min-height: 44px;
	min-width: 44px;
	padding: 0.5rem 1.1rem;
	border: 2px solid var(--accent);
	border-radius: 999px;
	background: transparent;
	color: var(--accent);
	text-decoration: none;
	cursor: pointer;
}

.primary {
	background: var(--accent);
	color: var(--on-accent);
}

.link-button {
	border: none;
	padding: 0.25rem 0.5rem;
	text-decoration: underline;
}

.actions,
.form-actions,
.dialog-actions,
.share-row,
.vote-group {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.actions {
	margin: 1rem 0 2rem;
}

.form-actions {
	margin-top: 1.5rem;
}

label {
	display: block;
	font-weight: 600;
	margin: 1rem 0 0.35rem;
}

input,
textarea {
	font: inherit;
	width: 100%;
	min-height: 44px;
	padding: 0.6rem 0.75rem;
	border: 2px solid var(--border);
	border-radius: 10px;
	background: var(--bg);
	color: var(--text);
}

.help {
	color: var(--muted);
	font-size: 0.95rem;
	margin: 0.35rem 0 0;
}

.check {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.check input {
	width: 1.5rem;
	height: 1.5rem;
	min-height: 0;
	margin: 0.1rem 0 0;
	accent-color: var(--accent);
}

.check label {
	margin: 0;
}

details {
	margin-top: 1.5rem;
	border-top: 1px solid var(--border);
	padding-top: 0.5rem;
}

summary {
	font-weight: 700;
	min-height: 44px;
	padding: 0.6rem 0;
	cursor: pointer;
}

.activity-list {
	list-style: none;
	padding: 0;
	margin: 1rem 0 0;
}

.activity-list li {
	padding: 0.75rem 0;
	border-top: 1px solid var(--border);
}

.activity-list a {
	font-size: 1.15rem;
	font-weight: 700;
}

.activity-list p {
	margin: 0.25rem 0 0;
	color: var(--muted);
}

.choice-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 1rem;
}

.choice {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 1.25rem;
}

.choice h3 {
	font-size: 1.3rem;
	margin: 0;
}

.choice p {
	margin: 0.25rem 0 0;
	color: var(--muted);
}

.vote-group {
	margin-top: 0.85rem;
}

.vote {
	border-color: var(--vote-color);
	color: var(--vote-color);
}

.vote-yes {
	--vote-color: var(--yes);
}

.vote-no {
	--vote-color: var(--no);
}

.vote-none {
	--vote-color: var(--none);
}

.vote[aria-pressed="true"] {
	background: var(--vote-color);
	color: var(--on-vote);
}

.vote[aria-pressed="true"]::before {
	content: "✓" / "";
	font-weight: 800;
}

.results h3 {
	margin: 1.25rem 0 0.25rem;
}

.tally {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 0;
}

.countdown {
	font-size: 1.5rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	margin: 1rem 0 0;
}

.share-row input {
	flex: 1 1 14rem;
}

.alert:not(:empty) {
	max-width: calc(var(--page-width) - 2rem);
	margin: 0 1rem 1rem;
	padding: 0.75rem 1rem;
	border: 2px solid var(--no);
	border-radius: 12px;
	background: var(--surface);
}

@media (min-width: 46rem) {
	.alert:not(:empty) {
		margin-inline: auto;
	}
}

dialog {
	width: min(32rem, calc(100vw - 2rem));
	border: none;
	border-radius: var(--radius);
	padding: 1.25rem;
	background: var(--surface);
	color: var(--text);
}

dialog::backdrop {
	background: rgb(0 0 0 / 0.55);
}

.dialog-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.dialog-header h2 {
	margin: 0.4rem 0 0;
}

.close-button {
	border: none;
	padding: 0;
	font-size: 1.6rem;
	color: var(--text);
}

.dialog-actions {
	justify-content: flex-end;
	margin-top: 1.5rem;
}

@media (prefers-reduced-motion: no-preference) {
	button,
	.button {
		transition: transform 0.1s ease, background-color 0.15s ease;
	}

	button:active,
	.button:active {
		transform: scale(0.96);
	}

	.choice {
		animation: pop-in 0.25s ease-out;
	}

	@keyframes pop-in {
		from {
			opacity: 0;
			transform: translateY(6px);
		}
	}
}
