:root {
	--cream: #f4efe6;
	--ink: #3c3834;
	--ink-soft: #5c564e;
	--font-serif: "Cormorant Garamond", "Times New Roman", serif;
	--font-script: "Allura", "Segoe Script", cursive;
}

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

html {
	scroll-behavior: smooth;
}

html,
body {
	margin: 0;
	padding: 0;
	background: var(--cream);
	color: var(--ink);
}

body {
	min-height: 100vh;
	font-family: var(--font-serif);
	-webkit-font-smoothing: antialiased;
}

.hero {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3vh 1.25rem 4vh;
	perspective: 1600px;
	background: var(--cream);
}

.envelope {
	position: relative;
	width: min(88vw, 520px);
	border: 0;
	padding: 0;
	background: transparent;
	cursor: pointer;
	font: inherit;
	color: inherit;
	text-align: center;
}

.envelope:focus-visible {
	outline: 1px dashed var(--ink-soft);
	outline-offset: 10px;
}

.envelope-stack {
	position: relative;
	width: 100%;
	aspect-ratio: 949 / 883;
}

.envelope-body,
.envelope-flap,
.envelope-closed {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.envelope-body {
	z-index: 1;
	display: block;
	object-fit: contain;
	pointer-events: none;
	user-select: none;
	filter: drop-shadow(0 14px 22px rgba(90, 78, 62, 0.14));
	transition: opacity 0.7s cubic-bezier(0.45, 0.02, 0.2, 1);
}

/* Under the flap so HTML type stays crisp on top */
.envelope-closed {
	z-index: 2;
	display: block;
	object-fit: contain;
	pointer-events: none;
	user-select: none;
	opacity: 1;
	transition: opacity 0.7s cubic-bezier(0.45, 0.02, 0.2, 1);
}

.envelope-flap {
	z-index: 3;
	transform-origin: 50% 0%;
	transform-style: preserve-3d;
	transition:
		transform 1.15s cubic-bezier(0.45, 0.02, 0.2, 1),
		opacity 1.15s cubic-bezier(0.45, 0.02, 0.2, 1);
	backface-visibility: hidden;
	pointer-events: none;
}

.flap-art {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	user-select: none;
}

.envelope-copy {
	position: absolute;
	left: 50%;
	top: 17%;
	z-index: 4;
	width: 78%;
	transform: translateX(-50%);
	text-align: center;
	pointer-events: none;
	transition: opacity 1.15s cubic-bezier(0.45, 0.02, 0.2, 1);
}

.kicker {
	margin: 0.55rem 0 0;
	font-size: clamp(0.58rem, 1.55vw, 0.72rem);
	font-weight: 500;
	letter-spacing: 0.42em;
	text-transform: uppercase;
	color: var(--ink);
	opacity: 0;
	animation: fade-rise 0.9s ease 0.35s forwards;
}

.names {
	margin: 0.6rem 0 0;
	font-family: var(--font-script);
	font-size: clamp(1.85rem, 6vw, 2.85rem);
	font-weight: 400;
	line-height: 1.1;
	color: var(--ink);
	opacity: 0;
	animation: fade-rise 0.95s ease 0.85s forwards;
}

.cta {
	position: absolute;
	left: 50%;
	top: 82%;
	bottom: auto;
	z-index: 5;
	transform: translateX(-50%);
	display: inline-block;
	padding: 0.35rem 0.5rem;
	font-size: clamp(0.66rem, 1.7vw, 0.8rem);
	font-weight: 500;
	letter-spacing: 0.38em;
	text-transform: uppercase;
	color: var(--ink);
	opacity: 0;
	/* Appear once, then soft brightness pulse (separate props = no mobile flash) */
	animation:
		cta-appear 0.85s ease 1.35s forwards,
		cta-pulse 2.6s ease 2.3s infinite;
	transition: opacity 1.15s cubic-bezier(0.45, 0.02, 0.2, 1);
	white-space: nowrap;
	pointer-events: none;
}

.envelope.is-open .envelope-closed,
.envelope.is-open .envelope-flap,
.envelope.is-open .envelope-body,
.envelope.is-open .envelope-copy,
.envelope.is-open .cta {
	opacity: 0;
}

.envelope.is-open .envelope-flap {
	transform: rotateX(-168deg);
}

.envelope.is-open .cta {
	animation: none;
}

.weekend {
	max-width: 920px;
	margin: 0 auto;
	padding: 5rem 1.5rem 4rem;
	text-align: center;
}

.weekend-kicker {
	margin: 0 0 2.75rem;
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.4em;
	text-transform: uppercase;
	color: var(--ink-soft);
}

.days {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem 1.5rem;
}

.days li {
	padding: 0 0.5rem;
}

.day {
	margin: 0;
	font-size: 0.78rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ink-soft);
}

.days h2 {
	margin: 0.45rem 0 0.35rem;
	font-size: 1.55rem;
	font-weight: 500;
}

.meta {
	margin: 0;
	font-size: 1.02rem;
	font-style: italic;
	color: var(--ink-soft);
}

.venue {
	max-width: 920px;
	margin: 0 auto;
	padding: 1rem 1.5rem 4rem;
	text-align: center;
}

.venue-figure {
	margin: 1.5rem auto 0;
	max-width: 720px;
}

.venue-art {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 2px;
}

.venue-name {
	margin: 0;
	font-size: clamp(1.45rem, 4vw, 1.85rem);
	font-weight: 500;
}

.venue-place {
	margin: 0.4rem 0 0;
	font-size: 1.05rem;
	font-style: italic;
	color: var(--ink-soft);
}

.contact {
	max-width: 920px;
	margin: 0 auto;
	padding: 1rem 1.5rem 3.5rem;
	text-align: center;
}

.contact-line {
	margin: 0;
	font-size: 1.15rem;
}

.contact-line a {
	color: var(--ink);
	text-decoration: none;
	border-bottom: 1px solid rgba(60, 56, 52, 0.35);
}

.contact-line a:hover {
	border-bottom-color: var(--ink);
}

.contact-note {
	margin: 0.85rem 0 0;
	font-size: 1.02rem;
	font-style: italic;
	color: var(--ink-soft);
}

.countdown {
	max-width: 920px;
	margin: 0 auto;
	padding: 1rem 1.5rem 5.5rem;
	text-align: center;
}

.countdown-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem;
	max-width: 520px;
	margin-inline: auto;
}

.countdown-grid li {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.countdown-grid span {
	font-size: clamp(1.6rem, 5vw, 2.35rem);
	font-weight: 500;
	letter-spacing: 0.04em;
	font-variant-numeric: tabular-nums;
}

.countdown-grid em {
	font-style: normal;
	font-size: 0.72rem;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--ink-soft);
}

@keyframes fade-rise {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes cta-appear {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes cta-pulse {
	0%,
	100% {
		filter: brightness(1);
	}
	50% {
		filter: brightness(0.72);
	}
}

@media (max-width: 700px) {
	.days {
		grid-template-columns: 1fr;
		gap: 2.4rem;
	}

	.cta {
		top: 80%;
		bottom: auto;
		letter-spacing: 0.28em;
	}

	.countdown-grid {
		gap: 0.65rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.cta {
		opacity: 1;
		animation: none;
		transform: translateX(-50%);
		filter: none;
	}

	.kicker,
	.names {
		opacity: 1;
		animation: none;
		transform: none;
	}

	.envelope-flap,
	.envelope-body,
	.envelope-closed {
		transition: none;
	}
}
