/* Toast Box -- warm letterpress. The whole visual argument is: this looks like
   a hand-set invitation, not a Google Form, so answering it feels personal.
   Palette is defined once on :root and only re-tinted for dark. */

:root {
	color-scheme: light dark;

	--paper: #fbf7f0;
	--paper-raised: #fffdf9;
	--paper-sunk: #f3ece1;
	--ink: #221e1a;
	--ink-soft: #4d443b;
	--ink-muted: #877a6c;
	--rule: #e3d9c9;
	--rule-strong: #cdbfa9;
	--accent: #a8532a;
	--accent-soft: #f0dfd2;
	--accent-ink: #ffffff;
	--gold: #b98b30;
	--danger: #a33a2f;

	--display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

	--radius: 14px;
	--shadow: 0 1px 2px rgb(60 40 20 / 6%), 0 8px 24px -12px rgb(60 40 20 / 18%);
	--measure: 34rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #17130f;
		--paper-raised: #211b16;
		--paper-sunk: #120e0b;
		--ink: #f3ebe0;
		--ink-soft: #d3c7b8;
		--ink-muted: #9b8d7c;
		--rule: #342b22;
		--rule-strong: #4a3d31;
		--accent: #e08a5a;
		--accent-soft: #3a2418;
		--accent-ink: #17130f;
		--gold: #d9ab55;
		--danger: #e07a6c;
		--shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 30px -14px rgb(0 0 0 / 70%);
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

/* The `hidden` attribute only sets `display: none` in the UA stylesheet, so any
   author rule that sets display -- .facts, .fact, .prompts -- silently beats it
   and renders an empty element. Toggling visibility via el.hidden is the pattern
   used throughout app.js and admin.js, so make it actually stick. */
[hidden] {
	display: none !important;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* A faint paper grain. Pure CSS, so it costs no request and never blocks. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	opacity: 0.5;
	background-image: radial-gradient(circle at 12% 18%, var(--paper-sunk) 0, transparent 45%),
		radial-gradient(circle at 88% 8%, var(--accent-soft) 0, transparent 38%);
}

.wrap {
	position: relative;
	z-index: 1;
	max-width: 46rem;
	margin: 0 auto;
	padding: 0 1.5rem 5rem;
}

h1,
h2,
h3 {
	font-family: var(--display);
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.12;
	margin: 0;
	font-variation-settings: "SOFT" 40, "WONK" 1;
}

a {
	color: var(--accent);
	text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ hero -- */

.hero {
	padding: 5rem 0 2.5rem;
	text-align: center;
}

.eyebrow {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ink-muted);
	margin: 0 0 1.5rem;
}

.eyebrow::after {
	content: "";
	display: block;
	width: 2.5rem;
	height: 1px;
	margin: 1.1rem auto 0;
	background: var(--rule-strong);
}

.hero h1 {
	font-size: clamp(2.6rem, 9vw, 4.2rem);
}

.hero h1 em {
	font-style: italic;
	color: var(--accent);
}

.occasion {
	font-family: var(--display);
	font-style: italic;
	font-size: 1.05rem;
	color: var(--ink-muted);
	margin: 1rem 0 0;
}

.lede {
	max-width: var(--measure);
	margin: 1.5rem auto 0;
	font-size: 1.09rem;
	color: var(--ink-soft);
	text-wrap: pretty;
}

/* Countdown + running total. Two small facts that do a lot of persuading. */
.facts {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.6rem;
	margin-top: 2rem;
}

.fact {
	display: inline-flex;
	align-items: baseline;
	gap: 0.45rem;
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--rule);
	border-radius: 999px;
	background: var(--paper-raised);
	font-size: 0.85rem;
	color: var(--ink-muted);
}

.fact b {
	font-family: var(--display);
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--ink);
}

.fact.urgent {
	border-color: var(--accent);
	background: var(--accent-soft);
}

.fact.urgent b {
	color: var(--accent);
}

/* --------------------------------------------------------------- prompts -- */

.section-head {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 3.5rem 0 1.25rem;
}

.section-head h2 {
	font-size: 1.28rem;
	white-space: nowrap;
}

.section-head::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--rule);
}

.hint {
	color: var(--ink-muted);
	font-size: 0.92rem;
	margin: 0 0 1.25rem;
}

.prompts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 0.7rem;
}

.prompt {
	position: relative;
	text-align: left;
	font: inherit;
	font-size: 0.95rem;
	color: var(--ink);
	background: var(--paper-raised);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	padding: 0.95rem 1.05rem;
	cursor: pointer;
	transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.prompt:hover {
	transform: translateY(-2px);
	border-color: var(--rule-strong);
	box-shadow: var(--shadow);
}

.prompt[aria-pressed="true"] {
	border-color: var(--accent);
	background: var(--accent-soft);
}

/* ------------------------------------------------------------------ form -- */

.card {
	background: var(--paper-raised);
	border: 1px solid var(--rule);
	border-radius: calc(var(--radius) + 4px);
	box-shadow: var(--shadow);
	padding: clamp(1.25rem, 4vw, 2rem);
}

.field {
	margin-bottom: 1.15rem;
}

.field:last-of-type {
	margin-bottom: 0;
}

label {
	display: block;
	font-size: 0.86rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	margin-bottom: 0.4rem;
}

label .optional {
	font-weight: 400;
	color: var(--ink-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
	width: 100%;
	font: inherit;
	color: var(--ink);
	background: var(--paper);
	border: 1px solid var(--rule-strong);
	border-radius: 10px;
	padding: 0.65rem 0.8rem;
	transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

textarea {
	min-height: 11rem;
	resize: vertical;
	line-height: 1.65;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

@media (max-width: 34rem) {
	.row {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

.counter {
	text-align: right;
	font-size: 0.78rem;
	color: var(--ink-muted);
	margin-top: 0.3rem;
}

.counter.over {
	color: var(--danger);
}

.check {
	display: flex;
	gap: 0.65rem;
	align-items: flex-start;
	padding: 0.85rem 1rem;
	border: 1px dashed var(--rule-strong);
	border-radius: 10px;
	background: var(--paper-sunk);
	cursor: pointer;
}

.check input {
	margin: 0.28rem 0 0;
	accent-color: var(--accent);
	flex-shrink: 0;
}

/* The surrounding `label` rule is 600; reset here or the description reads as
   semibold and the nested <b> resolves to 900 -- a weight we never load, so the
   browser fakes it. */
.check span {
	font-size: 0.88rem;
	font-weight: 400;
	color: var(--ink-soft);
}

.check b {
	display: block;
	font-weight: 600;
	color: var(--ink);
	font-size: 0.9rem;
}

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

.btn {
	font: inherit;
	font-weight: 600;
	border-radius: 999px;
	border: 1px solid transparent;
	padding: 0.7rem 1.5rem;
	cursor: pointer;
	transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

.btn:active {
	transform: translateY(1px);
}

.btn[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
}

.btn-primary {
	background: var(--accent);
	color: var(--accent-ink);
	width: 100%;
	padding: 0.85rem 1.5rem;
	font-size: 1rem;
}

.btn-ghost {
	background: transparent;
	color: var(--ink);
	border-color: var(--rule-strong);
}

.btn-ghost:hover {
	background: var(--paper-sunk);
}

.btn-sm {
	font-size: 0.82rem;
	padding: 0.4rem 0.85rem;
}

/* ----------------------------------------------------------------- states -- */

.alert {
	margin-top: 1rem;
	padding: 0.7rem 0.95rem;
	border-radius: 10px;
	font-size: 0.9rem;
	background: var(--accent-soft);
	color: var(--accent);
	border: 1px solid currentcolor;
}

.thanks {
	text-align: center;
	padding: 1rem 0 0.5rem;
}

.thanks .mark {
	font-family: var(--display);
	font-size: 3rem;
	color: var(--accent);
	line-height: 1;
}

.thanks h2 {
	font-size: 1.9rem;
	margin: 0.75rem 0 0;
}

.thanks p {
	color: var(--ink-soft);
	max-width: 28rem;
	margin: 0.7rem auto 0;
}

.share {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
	flex-wrap: wrap;
	margin-top: 1.6rem;
}

footer {
	margin-top: 3.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--rule);
	text-align: center;
	font-size: 0.82rem;
	color: var(--ink-muted);
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
