:root {
	color-scheme: light;
	--paper: #f8f2ed;
	--ink: #292a27;
	--muted: #77746e;
	--love: #d65b78;
	--love-deep: #9c3d5a;
	--love-pale: #f7dce2;
	--thought: #3982a3;
	--thought-deep: #245c76;
	--thought-pale: #d9eaf0;
	--serif: "Playfair Display", Georgia, serif;
	--sans: "DM Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
	min-width: 320px;
	min-height: 100vh;
	margin: 0;
	overflow-x: hidden;
	background-color: var(--paper);
	background-image: radial-gradient(rgba(67, 55, 46, .08) .65px, transparent .65px);
	background-size: 13px 13px;
	color: var(--ink);
	font-family: var(--sans);
}

button, textarea { font: inherit; }
button { color: inherit; }

.experience {
	position: relative;
	display: flex;
	min-height: 100vh;
	flex-direction: column;
	align-items: center;
	padding: 28px 28px 34px;
}

.music-toggle {
	position: fixed;
	z-index: 5;
	right: 22px;
	bottom: 20px;
	display: inline-flex;
	min-height: 42px;
	align-items: center;
	gap: 9px;
	padding: 0 13px;
	border: 1px solid rgba(64, 54, 46, .18);
	border-radius: 3px;
	background: rgba(255, 253, 250, .94);
	box-shadow: 0 5px 18px rgba(50, 42, 34, .1);
	color: var(--ink);
	cursor: pointer;
	font: 600 11px var(--sans);
}
.music-toggle[hidden] { display: none; }
.music-toggle:hover { border-color: var(--love); }
.music-toggle:focus-visible { outline: 3px solid rgba(214, 91, 120, .3); outline-offset: 3px; }
.music-toggle-icon { display: grid; width: 18px; aspect-ratio: 1; place-items: center; color: var(--love-deep); font-size: 13px; }

.topline {
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 9px;
	color: #77746e;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 1.7px;
}

.topline-mark { color: var(--love); font-size: 15px; }

.screen {
	width: min(100%, 900px);
	margin: auto;
	animation: screen-arrive .65s cubic-bezier(.2, .75, .25, 1) both;
}

.screen[hidden] { display: none; }

.birthday-screen { display: grid; width: min(100%, 560px); place-items: center; padding: 45px 10px; text-align: center; }
.birthday-content { width: min(100%, 430px); padding: 38px 34px; border: 1px solid rgba(64, 54, 46, .12); border-radius: 4px; background: rgba(255,253,250,.72); box-shadow: 0 18px 55px rgba(50,42,34,.08); }
.birthday-mark { display: inline-grid; width: 42px; aspect-ratio: 1; margin-bottom: 20px; place-items: center; border-radius: 50%; background: var(--love-pale); color: var(--love-deep); }
.birthday-content h1 { margin-bottom: 25px; font-size: clamp(34px, 5vw, 46px); }
.birthday-content form { display: grid; gap: 12px; text-align: left; }
.birthday-content .answer-label { margin: 0; }
#birthday-input { width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid #d9d2ca; border-radius: 3px; background: #fffdfa; color: var(--ink); font: inherit; }
#birthday-input:focus { border-color: var(--love); outline: 3px solid rgba(214,91,120,.16); }
.birthday-content .next-button { justify-self: start; margin-top: 8px; }
.birthday-feedback { min-height: 18px; margin: 0; color: var(--love-deep); font-size: 12px; }

.choice-screen { padding: 54px 0 15px; text-align: center; }
.intro-copy { margin-bottom: 47px; }
.eyebrow {
	margin: 0 0 16px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .3px;
}

h1, h2, p { margin-top: 0; }
h1, .qa-content h2, .done-screen h2 {
	margin-bottom: 17px;
	font-family: var(--serif);
	font-size: clamp(38px, 5vw, 58px);
	font-weight: 500;
	line-height: 1.12;
}

.title-period { color: var(--love); }
.intro-note { margin: 0; color: var(--muted); font-size: 14px; }

.envelope-choices {
	display: grid;
	width: min(100%, 650px);
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin: 0 auto;
}

.envelope-choice {
	position: relative;
	display: flex;
	min-height: 267px;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding: 20px 20px 22px;
	border: 1px solid rgba(64, 54, 46, .12);
	border-radius: 4px;
	background: rgba(255, 253, 250, .55);
	cursor: pointer;
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.envelope-choice:hover, .envelope-choice:focus-visible {
	transform: translateY(-5px);
	border-color: currentColor;
	box-shadow: 0 12px 30px rgba(54, 45, 37, .1);
}
.envelope-choice.is-locked, .envelope-choice.is-locked:hover, .envelope-choice.is-locked:focus-visible { transform: none; border-color: rgba(64, 54, 46, .12); box-shadow: none; cursor: not-allowed; }
.envelope-choice.is-locked .envelope-art { filter: grayscale(.55) drop-shadow(0 7px 7px rgba(40, 35, 30, .08)); }
.envelope-choice.is-locked .choice-description { color: #77746e; }
.envelope-choice.is-locked .choice-arrow { display: none; }
.letter-lock[hidden] { display: none; }
.letter-lock { position: absolute; right: 16px; bottom: 14px; width: 13px; height: 11px; border-radius: 2px; background: #77746e; }
.letter-lock::before { position: absolute; right: 2px; bottom: 7px; left: 2px; height: 8px; border: 2px solid #77746e; border-bottom: 0; border-radius: 7px 7px 0 0; content: ""; }
.letter-lock::after { position: absolute; top: 3px; left: 5px; width: 3px; height: 4px; border-radius: 50%; background: #fffdfa; content: ""; }

.envelope-choice:focus-visible, .back-button:focus-visible, .next-button:focus-visible, .quiet-button:focus-visible {
	outline: 3px solid rgba(57, 130, 163, .4);
	outline-offset: 4px;
}

.love-choice { color: var(--love-deep); }
.thought-choice { color: var(--thought-deep); }
.apology-choice { color: #a52c35; }
.secret-choice { color: #55534e; }
.farewell-choice { color: #8e3038; }
.draft-choice { color: #526b70; }

.envelope-art {
	position: relative;
	display: block;
	width: 145px;
	height: 108px;
	margin: 4px auto 23px;
	filter: drop-shadow(0 7px 7px rgba(40, 35, 30, .1));
	transition: transform .35s ease;
}

.envelope-choice:hover .envelope-art { transform: translateY(-5px) rotate(-2deg); }
.envelope-front, .envelope-flap, .envelope-letter { position: absolute; inset: 0; }
.envelope-front { z-index: 2; overflow: hidden; border-radius: 3px; }
.love-choice .envelope-front { background: linear-gradient(140deg, #f8b9c9, #ed91a8); }
.thought-choice .envelope-front { background: linear-gradient(140deg, #9bcddd, #75b2c7); }
.apology-choice .envelope-front { background: linear-gradient(140deg, #e87a78, #bd343f); }
.farewell-choice .envelope-front { background: linear-gradient(140deg, #cf7777, #9d3942); }
.draft-choice .envelope-front { background: linear-gradient(140deg, #bad0c9, #8daea7); }
.envelope-front::before, .envelope-front::after {
	position: absolute;
	bottom: -1px;
	width: 0;
	height: 0;
	content: "";
	border-style: solid;
}
.envelope-front::before { left: 0; border-width: 55px 73px 0 0; border-color: rgba(255,255,255,.32) transparent transparent; }
.envelope-front::after { right: 0; border-width: 0 73px 55px 0; border-color: transparent rgba(255,255,255,.22) transparent transparent; }
.envelope-flap { z-index: 3; width: 0; height: 0; border-style: solid; transform-origin: top; }
.love-choice .envelope-flap { border-width: 57px 73px 0; border-color: #e7839a transparent transparent; }
.thought-choice .envelope-flap { border-width: 57px 73px 0; border-color: #6eaec4 transparent transparent; }
.apology-choice .envelope-flap { border-width: 57px 73px 0; border-color: #c84a50 transparent transparent; }
.farewell-choice .envelope-flap { border-width: 57px 73px 0; border-color: #a94c53 transparent transparent; }
.draft-choice .envelope-flap { border-width: 57px 73px 0; border-color: #91b0a9 transparent transparent; }
.envelope-letter {
	z-index: 1;
	display: grid;
	width: 112px;
	height: 85px;
	margin: auto;
	place-items: center;
	border-radius: 2px;
	background: #fffaf6;
	font-family: var(--serif);
	font-size: 26px;
}
.love-choice .envelope-letter { color: var(--love); }
.thought-choice .envelope-letter { color: var(--thought); font-size: 34px; }
.apology-choice .envelope-letter { color: #b83440; }
.farewell-choice .envelope-letter { color: #9d3942; }
.draft-choice .envelope-letter { color: #526b70; }
.envelope-seal {
	position: absolute;
	z-index: 4;
	top: 43px;
	left: 60px;
	display: grid;
	width: 25px;
	aspect-ratio: 1;
	place-items: center;
	border-radius: 50%;
	background: #fff9f5;
	font-size: 11px;
}
.love-choice .envelope-seal { color: var(--love); }
.thought-choice .envelope-seal { color: var(--thought); }
.apology-choice .envelope-seal { color: #b83440; }
.farewell-choice .envelope-seal { color: #9d3942; }
.draft-choice .envelope-seal { color: #526b70; }
.secret-question-mark { position: relative; display: grid; width: 76px; aspect-ratio: 1; margin: 20px auto 35px; place-items: center; border: 2px solid #6c6963; border-radius: 50%; background: #fffdfa; color: #484640; font-family: var(--serif); font-size: 43px; box-shadow: 0 7px 12px rgba(40,35,30,.1); }
.secret-question-mark::after { position: absolute; right: 3px; bottom: -5px; width: 17px; height: 17px; content: ""; border-right: 2px solid #6c6963; border-bottom: 2px solid #6c6963; background: #fffdfa; transform: rotate(30deg); }
.gate-mark { margin-bottom: 20px; }
.secret-menu-screen { padding: 20px 0; text-align: center; }
.secret-menu-intro { margin: 45px auto 30px; }
.secret-menu-intro h1 { font-size: clamp(36px, 5vw, 50px); }
.secret-menu-choices { width: min(100%, 650px); }

.choice-label { margin-bottom: 6px; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.choice-description { color: var(--muted); font-size: 12px; }
.choice-arrow { position: absolute; right: 14px; bottom: 12px; font-size: 17px; opacity: .7; }
.signoff { margin: 40px 0 0; color: var(--muted); font-size: 11px; }
.signoff span { padding-left: 4px; color: var(--love); }
.history-link { margin-top: 21px; padding: 8px 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.history-link:hover { color: var(--ink); }

.letter-screen { width: min(100%, 700px); padding: 20px 0; }
.back-button {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 18px;
	padding: 8px 0;
	border: 0;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	font-size: 12px;
}
.back-button:hover { color: var(--ink); }
.letter-paper {
	--accent: var(--love-deep);
	--accent-light: var(--love-pale);
	width: min(100%, 620px);
	min-height: 490px;
	margin: 0 auto;
	padding: 41px clamp(25px, 7vw, 70px) 25px;
	border: 1px solid rgba(55, 45, 37, .1);
	border-radius: 3px;
	background: rgba(255, 253, 250, .9);
	box-shadow: 0 18px 55px rgba(50, 42, 34, .1);
}
.letter-paper.thought-theme { --accent: var(--thought-deep); --accent-light: var(--thought-pale); }
.letter-paper.apology-theme { --accent: #a52c35; --accent-light: #f5d9d9; }
.letter-topline { display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: 1.6px; }
.letter-stamp { display: grid; width: 26px; aspect-ratio: 1; place-items: center; border: 1px solid var(--accent-light); border-radius: 50%; background: var(--accent-light); font-size: 12px; }
.letter-title { margin: 26px 0 21px; color: var(--accent); font-family: var(--serif); font-size: 34px; font-weight: 500; }
.letter-body { color: #514d48; font-family: var(--serif); font-size: 16px; line-height: 1.85; }
.letter-body p { margin-bottom: 15px; animation: line-arrive .7s ease both; }
.letter-signature { margin: 23px 0 31px; color: var(--accent); font-family: var(--serif); font-size: 19px; font-style: italic; }
.letter-footer { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid rgba(55, 45, 37, .1); padding-top: 15px; }
.letter-actions { display: flex; width: min(100%, 620px); min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; margin: 0 auto; }
.save-button { display: inline-flex; min-height: 38px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid rgba(55,45,37,.16); border-radius: 3px; background: rgba(255,253,250,.7); color: var(--ink); cursor: pointer; font-size: 11px; }
.save-button:hover { border-color: var(--thought); }
.save-status { color: var(--muted); font-size: 11px; }
.wait-note { color: var(--muted); font-size: 11px; }
.wait-note.unlocked { color: var(--accent); }
.next-button {
	display: inline-flex;
	min-height: 42px;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 0 17px;
	border: 0;
	border-radius: 3px;
	background: var(--ink);
	color: #fffaf6;
	cursor: pointer;
	font-size: 12px;
	transition: opacity .2s ease, transform .2s ease, background .2s ease;
}
.next-button:hover:not(:disabled) { transform: translateY(-2px); background: #43433e; }
.next-button:disabled { cursor: not-allowed; opacity: .42; }
.next-button[hidden] { display: none; }

.qa-screen { width: min(100%, 700px); padding: 20px 0; }
.secret-gate-screen, .composer-screen, .generated-screen { width: min(100%, 700px); padding: 20px 0; }
.secret-gate-screen .birthday-content h2 { margin-bottom: 25px; color: var(--ink); font-family: var(--serif); font-size: clamp(32px, 5vw, 44px); font-weight: 500; line-height: 1.15; }
.composer-content { width: min(100%, 620px); margin: 25px auto; padding: 0 10px; }
.composer-content h2 { margin-bottom: 25px; font-family: var(--serif); font-size: clamp(34px, 5vw, 48px); font-weight: 500; }
.composer-form { display: grid; gap: 19px; }
.composer-addresses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.composer-form > div { display: grid; gap: 8px; }
.composer-form input, .composer-form textarea, .composer-form select { width: 100%; padding: 12px 13px; border: 1px solid #d9d2ca; border-radius: 3px; outline: none; background: rgba(255,253,250,.84); color: var(--ink); font: 15px var(--serif); }
.composer-form input, .composer-form select { min-height: 44px; }
.composer-form textarea { min-height: 210px; resize: vertical; line-height: 1.7; }
.composer-form input:focus, .composer-form textarea:focus, .composer-form select:focus { border-color: var(--thought); box-shadow: 0 0 0 3px rgba(57,130,163,.12); }
.composer-form [hidden] { display: none; }
.composer-form .next-button { justify-self: start; }
.generated-screen { width: min(100%, 760px); }
.generated-letter { --generated-accent: #526b70; --generated-paper: #f3f5f4; width: min(100%, 650px); min-height: 520px; margin: 0 auto; padding: 56px clamp(28px, 7vw, 76px); border: 1px solid rgba(55,45,37,.1); border-radius: 3px; background: var(--generated-paper); box-shadow: 0 18px 55px rgba(50,42,34,.1); }
.generated-letter[data-theme="love"] { border-top: 5px solid #d65b78; }
.generated-letter[data-theme="apology"] { border-top: 5px solid #a52c35; }
.generated-letter[data-theme="farewell"] { border-top: 5px solid #3982a3; }
.generated-letter[data-theme="excuse"] { border-top: 5px solid #317873; }
.generated-letter[data-theme="christmas"] { border: 1px solid rgba(66,106,69,.24); border-top: 7px solid #426a45; box-shadow: inset 0 4px #a52c35, 0 18px 55px rgba(50,42,34,.1); }
.generated-date { margin-bottom: 58px; color: var(--muted); font-size: 13px; }
.generated-kicker { margin: 0 0 14px; color: var(--generated-accent); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.generated-letter h2 { margin-bottom: 42px; color: var(--generated-accent); font-family: var(--serif); font-size: 32px; font-weight: 500; }
.generated-to, .generated-message, .generated-from { color: #393833; font-family: var(--serif); font-size: 17px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.generated-message { min-height: 170px; margin: 24px 0 34px; }
.generated-from { margin-top: 40px; }
.consent-screen { width: min(100%, 700px); padding: 20px 0; }
.share-screen { width: min(100%, 700px); padding: 20px 0; }
.consent-content { width: min(100%, 560px); margin: 60px auto 0; padding: 0 10px; }
.consent-content h2 { max-width: 500px; margin-bottom: 20px; font-family: var(--serif); font-size: clamp(36px, 5vw, 52px); font-weight: 500; line-height: 1.15; }
.consent-note { max-width: 460px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.consent-note strong { color: var(--ink); font-weight: 600; }
.consent-actions { display: flex; align-items: center; gap: 28px; margin-top: 30px; }
.answer-save-actions { display: flex; align-items: flex-start; flex-direction: column; gap: 14px; margin-top: 30px; }
.qa-content { width: min(100%, 550px); margin: 29px auto 0; padding: 0 10px; }
.qa-content h2, .done-screen h2 { font-size: clamp(37px, 5vw, 52px); }
.qa-progress { width: 100%; height: 3px; margin: 31px 0; background: #e2dcd5; }
.qa-progress-fill { display: block; width: 33.333%; height: 100%; background: var(--love); transition: width .3s ease; }
.qa-question { min-height: 65px; margin-bottom: 18px; font-family: var(--serif); font-size: 24px; line-height: 1.45; }
.answer-feedback { max-width: 470px; margin: -10px 0 23px; color: var(--love-deep); font-family: var(--serif); font-size: 15px; line-height: 1.6; animation: line-arrive .35s ease both; }
.binary-answers { display: flex; gap: 12px; margin: 20px 0 28px; }
.answer-choice { min-width: min(100px, 100%); min-height: 44px; padding: 0 16px; border: 1px solid #d9d2ca; border-radius: 3px; background: rgba(255,253,250,.72); color: var(--ink); cursor: pointer; font-size: 13px; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.answer-choice:hover { border-color: var(--love); }
.answer-choice[aria-pressed="true"] { border-color: var(--love-deep); background: var(--love-pale); color: var(--love-deep); }
.answer-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 600; }
#answer-input { display: block; width: 100%; min-height: 100px; resize: vertical; padding: 13px 14px; border: 1px solid #d9d2ca; border-radius: 3px; outline: none; background: rgba(255,253,250,.72); color: var(--ink); font-family: var(--serif); font-size: 15px; line-height: 1.6; }
#answer-input:focus { border-color: var(--thought); box-shadow: 0 0 0 3px rgba(57,130,163,.12); }
.qa-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 21px; }
.quiet-button { padding: 8px 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.quiet-button:hover { color: var(--ink); }
.done-screen { width: min(100%, 600px); padding: 65px 15px; text-align: center; }
.done-mark { display: inline-grid; width: 52px; aspect-ratio: 1; margin-bottom: 22px; place-items: center; border-radius: 50%; background: var(--love-pale); color: var(--love-deep); font-size: 25px; }
.done-note { margin-bottom: 25px; color: var(--muted); font-size: 13px; }
.done-screen > .next-button { margin: 0 auto 12px; }
.history-screen { width: min(100%, 700px); padding: 20px 0; }
.history-content { width: min(100%, 600px); margin: 30px auto; padding: 0 10px; }
.history-content h2 { margin-bottom: 24px; font-family: var(--serif); font-size: clamp(36px, 5vw, 50px); font-weight: 500; }
.history-list { display: grid; gap: 18px; }
.history-entry { padding: 20px 22px; border: 1px solid rgba(55, 45, 37, .12); border-radius: 3px; background: rgba(255,253,250,.72); }
.history-entry h3 { margin: 0 0 5px; font-family: var(--serif); font-size: 20px; font-weight: 500; }
.history-download { margin-top: 12px; }
.history-date, .history-empty { color: var(--muted); font-size: 12px; }
.history-date { margin-bottom: 16px; }
.answer-item { padding: 14px 0; border-top: 1px solid rgba(55, 45, 37, .12); }
.answer-item p { margin: 0; }
.answer-item .answer-prompt { margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.answer-item .answer-response { color: var(--ink); font-family: var(--serif); font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
.ambient-dot { position: fixed; z-index: -1; width: 220px; aspect-ratio: 1; border-radius: 50%; opacity: .12; filter: blur(1px); pointer-events: none; }
.dot-one { top: 12%; left: -150px; background: var(--love); }
.dot-two { right: -155px; bottom: 8%; background: var(--thought); }

@keyframes screen-arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes line-arrive { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
	.experience { padding: 22px 19px 25px; }
	.music-toggle { right: 14px; bottom: 14px; }
	.birthday-content { padding: 32px 23px; }
	.choice-screen { padding: 45px 0 10px; }
	.intro-copy { margin-bottom: 35px; }
	.envelope-choices { gap: 12px; }
	.envelope-choice { min-height: 229px; padding: 16px 9px 18px; }
	.envelope-art { transform: scale(.85); margin: -1px auto 13px; }
	.envelope-choice:hover .envelope-art { transform: scale(.85) translateY(-5px) rotate(-2deg); }
	.choice-label { font-size: 18px; }
	.choice-description { max-width: 150px; font-size: 11px; line-height: 1.5; }
	.signoff { margin-top: 31px; }
	.letter-paper { min-height: 0; padding: 31px 24px 21px; }
	.letter-body { font-size: 15px; }
	.letter-title { font-size: 30px; }
	.letter-footer { align-items: flex-end; }
	.wait-note { max-width: 180px; line-height: 1.5; }
	.letter-actions { flex-wrap: wrap; }
	.consent-content { margin-top: 42px; }
	.consent-actions { align-items: flex-start; flex-direction: column-reverse; gap: 16px; }
	.answer-save-actions { align-items: stretch; }
	.qa-content { margin-top: 24px; }
	.composer-addresses { grid-template-columns: 1fr; }
	.generated-letter { min-height: 0; padding: 38px 25px; }
	.generated-date { margin-bottom: 38px; }
	.generated-letter h2 { margin-bottom: 30px; }
}

@media (max-width: 400px) {
	.binary-answers { flex-wrap: wrap; }
	.answer-choice { flex: 0 1 100px; }
}

@media (max-width: 370px) {
	.envelope-choices { gap: 9px; }
	.choice-label { font-size: 16px; }
	.envelope-art { transform: scale(.76); margin-left: -5px; margin-right: -5px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
