:root {
	--bg: #0c0a08;
	--bg-elev: #15110d;
	--ink: #f4ead3;
	--ink-dim: #c9bfa6;
	--ink-faint: #7a7059;
	--accent: #d4391f; /* curtain red */
	--accent-soft: #8a2818;
	--gold: #c8a04a;
	--rule: rgba(244, 234, 211, 0.14);
	--max: 1240px;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html,
body {
	background: var(--bg);
	color: var(--ink);
	font-family: "Fraunces", "Times New Roman", Times, serif;
	font-variation-settings:
		"opsz" 14,
		"SOFT" 50,
		"WONK" 0;
	font-weight: 400;
	line-height: 1.45;
	min-height: 100vh;
	overflow-x: hidden;
}

body {
	background-image:
		radial-gradient(
			ellipse at 50% -10%,
			rgba(212, 57, 31, 0.18) 0%,
			transparent 55%
		),
		radial-gradient(
			ellipse at 80% 110%,
			rgba(200, 160, 74, 0.08) 0%,
			transparent 50%
		);
	background-attachment: fixed;
}

/* Film-grain overlay */
.grain {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 100;
	opacity: 0.06;
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='1'/></svg>");
}

/* ----- Masthead ----- */
.masthead {
	max-width: var(--max);
	margin: 0 auto;
	padding: 6vh 6vw 4vh;
	border-bottom: 1px solid var(--rule);
	position: relative;
}

.masthead__top {
	display: flex;
	justify-content: space-between;
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 0.72rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ink-faint);
	margin-bottom: 3vh;
}

.masthead__title {
	font-family: "Fraunces", serif;
	font-variation-settings:
		"opsz" 144,
		"SOFT" 100,
		"WONK" 1;
	font-weight: 900;
	font-size: clamp(4rem, 14vw, 12rem);
	line-height: 0.88;
	letter-spacing: -0.04em;
	color: var(--ink);
}

.masthead__title-row {
	display: block;
}

.masthead__title-row--ital {
	font-style: italic;
	color: var(--accent);
	margin-left: 0.4em;
	font-variation-settings:
		"opsz" 144,
		"SOFT" 100,
		"WONK" 1;
}

.masthead__sub {
	margin-top: 2vh;
	font-size: clamp(1rem, 1.6vw, 1.3rem);
	font-style: italic;
	color: var(--ink-dim);
	max-width: 38ch;
}

.masthead__sub .holiday-name {
	color: var(--gold);
	font-style: normal;
	font-weight: 600;
}

/* ----- Picks list ----- */
.picks {
	max-width: var(--max);
	margin: 0 auto;
	padding: 4vh 6vw 8vh;
}

.pick {
	display: grid;
	grid-template-columns: 80px 220px 1fr;
	gap: 3rem;
	align-items: start;
	padding: 4vh 0;
	border-bottom: 1px solid var(--rule);
	opacity: 0;
	transform: translateY(20px);
	animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.pick:nth-child(1) {
	animation-delay: 0.05s;
}
.pick:nth-child(2) {
	animation-delay: 0.18s;
}
.pick:nth-child(3) {
	animation-delay: 0.31s;
}
.pick:nth-child(4) {
	animation-delay: 0.44s;
}
.pick:nth-child(5) {
	animation-delay: 0.57s;
}

@keyframes rise {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.pick__num {
	font-family: "Fraunces", serif;
	font-variation-settings:
		"opsz" 144,
		"WONK" 1;
	font-weight: 300;
	font-style: italic;
	font-size: clamp(3rem, 6vw, 5.5rem);
	color: var(--accent);
	line-height: 1;
}

.pick__poster {
	width: 220px;
	aspect-ratio: 2 / 3;
	background: var(--bg-elev);
	border: 1px solid var(--rule);
	overflow: hidden;
	position: relative;
	box-shadow:
		0 20px 40px -20px rgba(0, 0, 0, 0.8),
		0 0 0 1px rgba(244, 234, 211, 0.05);
	transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pick__poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pick:hover .pick__poster {
	transform: translateY(-4px) rotate(-0.5deg);
}

.pick__poster-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: var(--ink-faint);
	font-family: "JetBrains Mono", monospace;
	font-size: 0.7rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	padding: 1rem;
	text-align: center;
}

.pick__poster-badge {
	position: absolute;
	bottom: 0.5rem;
	right: 0.5rem;
	font-family: "JetBrains Mono", monospace;
	font-size: 0.55rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	padding: 0.2rem 0.45rem;
	background: rgba(12, 10, 8, 0.75);
	color: var(--gold);
	border: 1px solid rgba(200, 160, 74, 0.3);
	backdrop-filter: blur(4px);
	border-radius: 2px;
	pointer-events: none;
}

.pick__body {
	padding-top: 0.5rem;
}

.pick__title {
	font-family: "Fraunces", serif;
	font-variation-settings:
		"opsz" 72,
		"SOFT" 50,
		"WONK" 0;
	font-weight: 700;
	font-size: clamp(1.8rem, 3.5vw, 2.8rem);
	line-height: 1.05;
	letter-spacing: -0.02em;
	margin-bottom: 0.6rem;
}

.pick__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.8rem;
	font-family: "JetBrains Mono", monospace;
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-faint);
	margin-bottom: 1.4rem;
}

.pick__meta span:not(:last-child)::after {
	content: "·";
	margin-left: 0.8rem;
	color: var(--ink-faint);
}

.pick__summary {
	font-size: 1.05rem;
	line-height: 1.6;
	color: var(--ink-dim);
	max-width: 60ch;
	margin-bottom: 1.4rem;
}

.pick__genres {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.pick__genre {
	font-family: "JetBrains Mono", monospace;
	font-size: 0.68rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 0.3rem 0.7rem;
	border: 1px solid var(--rule);
	color: var(--ink-dim);
	border-radius: 999px;
}

/* ----- Loading & errors ----- */
.loading {
	display: flex;
	justify-content: center;
	gap: 0.6rem;
	padding: 10vh 0;
}

.loading__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent);
	animation: blink 1.4s ease-in-out infinite;
}

.loading__dot:nth-child(2) {
	animation-delay: 0.2s;
}

.loading__dot:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes blink {
	0%,
	80%,
	100% {
		opacity: 0.2;
	}
	40% {
		opacity: 1;
	}
}

.error {
	padding: 4vh 0;
	color: var(--ink-dim);
	font-style: italic;
	max-width: 60ch;
}

.error code {
	font-family: "JetBrains Mono", monospace;
	background: var(--bg-elev);
	padding: 0.15rem 0.4rem;
	border-radius: 3px;
	font-size: 0.85em;
	color: var(--accent);
}

/* ----- Footer ----- */
.footer {
	max-width: var(--max);
	margin: 0 auto;
	padding: 3vh 6vw 6vh;
	border-top: 1px solid var(--rule);
	font-family: "JetBrains Mono", monospace;
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-faint);
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.footer__btn {
	background: none;
	border: 1px solid var(--rule);
	color: var(--ink-dim);
	font: inherit;
	padding: 0.45rem 0.9rem;
	cursor: pointer;
	transition:
		color 0.2s,
		border-color 0.2s,
		background 0.2s;
}

.footer__btn:hover {
	color: var(--accent);
	border-color: var(--accent);
	background: rgba(212, 57, 31, 0.08);
}

/* ----- Responsive ----- */
@media (max-width: 820px) {
	.pick {
		grid-template-columns: 60px 1fr;
		gap: 1.2rem;
	}
	.pick__poster {
		grid-column: 2;
		width: 160px;
		margin-bottom: 1rem;
	}
	.pick__body {
		grid-column: 2;
	}
	.pick__num {
		font-size: 3rem;
	}
}

@media (max-width: 480px) {
	.masthead {
		padding: 5vh 5vw 3vh;
	}
	.pick__poster {
		width: 130px;
	}
}

/* ----- Birthday celebration ----- */
.bday {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: center;
	background: radial-gradient(
		ellipse at 50% 40%,
		rgba(12, 10, 8, 0.72),
		rgba(12, 10, 8, 0.93)
	);
	backdrop-filter: blur(3px);
	animation: bdayFade 0.4s ease both;
	cursor: pointer;
}

@keyframes bdayFade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.bday__confetti {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.bday__piece {
	position: absolute;
	top: -18px;
	opacity: 0.92;
	animation-name: bdayFall;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}

@keyframes bdayFall {
	0% {
		transform: translateY(-18px) rotateZ(0deg);
	}
	100% {
		transform: translateY(104vh) rotateZ(900deg);
	}
}

.bday__card {
	position: relative;
	z-index: 1;
	text-align: center;
	max-width: 90vw;
	padding: clamp(2rem, 5vw, 3.5rem) clamp(2rem, 6vw, 4.5rem);
	background: linear-gradient(160deg, var(--bg-elev), #0c0a08);
	border: 1px solid rgba(200, 160, 74, 0.35);
	border-radius: 14px;
	box-shadow:
		0 40px 80px -30px rgba(0, 0, 0, 0.9),
		0 0 0 1px rgba(244, 234, 211, 0.05),
		0 0 60px -20px rgba(200, 160, 74, 0.4);
	animation: bdayPop 0.7s cubic-bezier(0.2, 0.9, 0.25, 1.2) both;
	cursor: default;
}

@keyframes bdayPop {
	0% {
		transform: scale(0.7) translateY(20px);
		opacity: 0;
	}
	60% {
		transform: scale(1.04) translateY(0);
		opacity: 1;
	}
	100% {
		transform: scale(1);
	}
}

.bday__cake {
	font-size: clamp(2.5rem, 8vw, 4.5rem);
	line-height: 1;
	margin-bottom: 0.6rem;
	animation: bdayBob 2.4s ease-in-out infinite;
}

@keyframes bdayBob {
	0%,
	100% {
		transform: translateY(0) rotate(-3deg);
	}
	50% {
		transform: translateY(-8px) rotate(3deg);
	}
}

.bday__msg {
	font-family: "Fraunces", serif;
	font-variation-settings:
		"opsz" 144,
		"SOFT" 100,
		"WONK" 1;
	font-weight: 900;
	font-style: italic;
	font-size: clamp(1.8rem, 5.5vw, 3.4rem);
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: var(--gold);
	margin-bottom: 0.5rem;
}

.bday__sub {
	font-family: "JetBrains Mono", monospace;
	font-size: 0.78rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--ink-dim);
	margin-bottom: 1.6rem;
}

.bday__close {
	background: none;
	border: 1px solid var(--rule);
	color: var(--ink-dim);
	font-family: "JetBrains Mono", monospace;
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	padding: 0.5rem 1.1rem;
	cursor: pointer;
	transition:
		color 0.2s,
		border-color 0.2s,
		background 0.2s;
}

.bday__close:hover {
	color: var(--gold);
	border-color: var(--gold);
	background: rgba(200, 160, 74, 0.08);
}

/* Valentine's hearts variant */
.bday__heart {
	position: absolute;
	bottom: -48px;
	line-height: 1;
	opacity: 0;
	animation-name: bdayFloat;
	animation-timing-function: ease-in;
	animation-iteration-count: infinite;
}

@keyframes bdayFloat {
	0% {
		transform: translateY(0) scale(0.5) rotate(-8deg);
		opacity: 0;
	}
	12% {
		opacity: 0.95;
	}
	100% {
		transform: translateY(-112vh) scale(1.15) rotate(12deg);
		opacity: 0;
	}
}

.bday--love .bday__card {
	border-color: rgba(255, 94, 138, 0.45);
	box-shadow:
		0 40px 80px -30px rgba(0, 0, 0, 0.9),
		0 0 0 1px rgba(244, 234, 211, 0.05),
		0 0 70px -18px rgba(255, 94, 138, 0.55);
}

.bday--love .bday__msg {
	color: #ff5e8a;
}

.bday--love .bday__cake {
	animation: bdayBeat 1.1s ease-in-out infinite;
}

@keyframes bdayBeat {
	0%,
	100% {
		transform: scale(1);
	}
	25% {
		transform: scale(1.18);
	}
	40% {
		transform: scale(1);
	}
	60% {
		transform: scale(1.12);
	}
}

@media (prefers-reduced-motion: reduce) {
	.bday__piece,
	.bday__heart {
		display: none;
	}
	.bday__cake {
		animation: none;
	}
}
