:root {
	--ink: #1f2a22;
	--moss: #3d4a3b;
	--sage: #8a9a7b;
	--cream: #f7f2e8;
	--paper: #fffdf8;
	--gold: #c3a467;
	--gold-dark: #9c7f45;
	--line: #e6dfd0;
	--danger: #a6463b;
	--serif: 'Cormorant Garamond', Georgia, serif;
	--script: 'Pinyon Script', 'Snell Roundhand', cursive;
	--sans: 'Jost', system-ui, -apple-system, sans-serif;
	--safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
	font-family: var(--sans);
	color: var(--ink);
	background: var(--ink);
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }

/* ------------------------------------------------------------ hero */
.hero {
	position: relative;
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	color: var(--cream);
	overflow: hidden;
	isolation: isolate;
}
.hero-bg {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: url('/bg-sm.jpg') 51% 50% / cover no-repeat;
	animation: settle 2.4s ease-out both;
}
.hero-bg::after {
	content: '';
	position: absolute;
	inset: 0;
	background:
		linear-gradient(to bottom, rgba(20, 28, 22, 0.78) 0%, rgba(20, 28, 22, 0.25) 26%, rgba(20, 28, 22, 0) 42%),
		linear-gradient(to top, rgba(20, 28, 22, 0.94) 0%, rgba(20, 28, 22, 0.7) 24%, rgba(20, 28, 22, 0.25) 40%, rgba(20, 28, 22, 0) 52%);
}
@media (min-width: 901px) {
	.hero-bg { background-image: url('/bg.jpg'); background-position: 50% 55%; }
}
@keyframes settle { from { transform: scale(1.06); } to { transform: scale(1); } }

.hero-top {
	padding: calc(env(safe-area-inset-top, 0px) + 44px) 24px 0;
	text-align: center;
	animation: rise 1s 0.2s ease-out both;
}
.script {
	font-family: var(--script);
	font-size: clamp(2.3rem, 11vw, 3.6rem);
	line-height: 1.1;
	margin: 0 0 4px;
	color: #fff;
	text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
h1 {
	font-family: var(--serif);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.22em;
	font-size: clamp(1.15rem, 5.4vw, 1.6rem);
	margin: 0;
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}
.date {
	margin: 10px 0 0;
	font-size: 0.78rem;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	opacity: 0.9;
}
.date::before, .date::after { content: '—'; margin: 0 0.7em; opacity: 0.6; }

.hero-bottom {
	padding: 0 24px calc(var(--safe-b) + 28px);
	text-align: center;
	max-width: 460px;
	width: 100%;
	margin: 0 auto;
	animation: rise 1s 0.45s ease-out both;
}
.lede {
	font-family: var(--serif);
	font-size: 1.22rem;
	line-height: 1.4;
	margin: 0 0 20px;
	text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 56px;
	padding: 0 34px;
	border: 0;
	border-radius: 999px;
	font: 500 1rem/1 var(--sans);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
	user-select: none;
	transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 22px; height: 22px; }
.btn-primary { background: var(--cream); color: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.hero .btn-primary { width: 100%; }
.sheet .btn-primary { background: var(--ink); color: var(--cream); box-shadow: none; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

.btn-link {
	display: block;
	margin: 14px auto 0;
	padding: 8px 12px;
	background: none;
	border: 0;
	color: var(--cream);
	font: 400 0.95rem var(--sans);
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-color: rgba(247, 242, 232, 0.5);
	cursor: pointer;
}
.btn-link.dark { color: var(--moss); text-decoration-color: var(--line); }

/* ------------------------------------------------------------ sheet */
.sheet-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 20, 16, 0.55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	z-index: 10;
	animation: fade 0.25s ease both;
}
.sheet {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 11;
	max-height: 92vh;
	max-height: 92svh;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--paper);
	border-radius: 22px 22px 0 0;
	padding: 10px 22px calc(var(--safe-b) + 22px);
	box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
	animation: up 0.35s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@media (min-width: 600px) {
	.sheet { left: 50%; right: auto; width: 520px; transform: translateX(-50%); animation-name: up-center; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes up-center { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }

.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; margin: 4px 0 12px; }
.icon-btn {
	width: 40px; height: 40px;
	border: 0; border-radius: 50%;
	background: var(--cream);
	color: var(--moss);
	font-size: 1.6rem; line-height: 1;
	cursor: pointer;
}

.picked {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
}
.picked:empty { display: none; }
.thumb {
	position: relative;
	aspect-ratio: 1;
	border-radius: 10px;
	overflow: hidden;
	background: var(--cream);
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x {
	position: absolute; top: 4px; right: 4px;
	width: 24px; height: 24px;
	border: 0; border-radius: 50%;
	background: rgba(20, 28, 22, 0.7); color: #fff;
	font-size: 0.95rem; line-height: 24px; padding: 0;
	cursor: pointer;
}
.thumb .badge {
	position: absolute; left: 5px; bottom: 5px;
	background: rgba(20, 28, 22, 0.7); color: #fff;
	font-size: 0.65rem; padding: 2px 6px; border-radius: 6px;
	letter-spacing: 0.05em;
}
.thumb .fallback { display: grid; place-items: center; height: 100%; font-size: 0.7rem; color: var(--moss); padding: 4px; text-align: center; word-break: break-all; }
.thumb.done::after, .thumb.failed::after {
	content: '✓';
	position: absolute; inset: 0;
	display: grid; place-items: center;
	background: rgba(31, 42, 34, 0.45);
	color: #fff; font-size: 1.5rem;
}
.thumb.failed::after { content: '!'; background: rgba(166, 70, 59, 0.6); }

.add-more {
	display: inline-block;
	margin: 10px 0 4px;
	color: var(--gold-dark);
	font-weight: 500;
	cursor: pointer;
	padding: 6px 0;
}

.field { display: block; margin-top: 14px; }
.field span { display: block; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--moss); margin-bottom: 6px; }
.field em { text-transform: none; letter-spacing: 0; font-style: normal; color: var(--sage); }
.field input, .field textarea {
	width: 100%;
	border: 1px solid var(--line);
	background: #fff;
	border-radius: 12px;
	padding: 14px;
	font: 16px/1.4 var(--sans); /* 16px stops iOS zooming in */
	color: var(--ink);
	resize: vertical;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
#share-form .btn { margin-top: 20px; }

.form-error { color: var(--danger); margin: 12px 0 0; font-size: 0.95rem; }
.muted { color: var(--moss); opacity: 0.85; }
.small { font-size: 0.85rem; }
.center { text-align: center; }

.bar { height: 8px; background: var(--cream); border-radius: 4px; overflow: hidden; margin: 18px 0; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--gold)); transition: width 0.3s ease; }

.check { color: var(--sage); width: 72px; margin: 10px auto 0; }
.check svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.6s 0.2s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
#step-done .btn { margin-top: 18px; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
