/* dearmark.dad-look.com - an open letter to Mark, on cream paper against the night sky */
body { margin: 0; background: #1d2340; color: #f3efe6; font-family: Helvetica, Arial, sans-serif; }
[hidden] { display: none !important; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid #ec6e6a; outline-offset: 3px; }
.dm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; }
main { max-width: 760px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; gap: 64px; }

/* Top */
.dm-top { max-width: 760px; margin: 0 auto; padding: 48px 24px 26px; }
.dm-kicker { margin: 0; font-size: 13px; font-weight: 900; letter-spacing: 0.3em; text-transform: uppercase; color: #ec6e6a; }
.dm-to { margin: 8px 0 0; font-size: 15px; line-height: 1.6; color: #b9bdd6; }

/* The letter */
.dm-letter { position: relative; padding: 46px 52px 40px; background: #fbf7ee; color: #1d2340; font-family: Georgia, "Times New Roman", serif; font-size: 19px; line-height: 1.65; box-shadow: 0 24px 50px rgba(0, 0, 0, 0.4);
	background-image: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(29, 35, 64, 0.07) 31px 32px); }
.dm-letter::before { content: ""; position: absolute; top: 0; bottom: 0; left: 30px; width: 2px; background: rgba(236, 110, 106, 0.35); }
.dm-date { margin: 0 0 18px; text-align: right; font-size: 15px; font-style: italic; color: #5c6283; }
.dm-letter h1 { margin: 0 0 18px; font-size: 38px; line-height: 1.2; font-weight: 700; }
.dm-letter p { margin: 0 0 16px; }
.dm-hl { background: linear-gradient(to top, rgba(236, 110, 106, 0.4) 40%, transparent 40%); }
.dm-sign { margin-top: 26px !important; }
.dm-sign img { display: block; margin-top: 6px; width: 200px; height: auto; }
.dm-ps { margin: 22px 0 0 !important; font-size: 16px; font-style: italic; color: #5c6283; }

/* The invoice */
.dm-invoice { position: relative; padding: 32px; background: #ffffff; color: #1d2340; font-family: "Courier New", Courier, monospace; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); overflow: hidden; }
.dm-invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 3px double #1d2340; padding-bottom: 14px; }
.dm-invoice h2 { margin: 0; font-size: 34px; letter-spacing: 0.1em; text-transform: uppercase; }
.dm-invoice-head p { margin: 0; text-align: right; font-size: 14px; line-height: 1.5; }
.dm-invoice table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 15px; }
.dm-invoice th, .dm-invoice td { padding: 10px 6px; text-align: left; border-bottom: 1px dashed #c3c6d6; vertical-align: top; }
.dm-invoice thead th { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: #5c6283; }
.dm-invoice td:nth-child(2), .dm-invoice th:nth-child(2) { text-align: center; white-space: nowrap; }
.dm-invoice td:last-child, .dm-invoice thead th:last-child { text-align: right; white-space: nowrap; }
.dm-invoice tfoot th, .dm-invoice tfoot td { border-bottom: 0; border-top: 3px double #1d2340; font-size: 19px; font-weight: 700; }
.dm-stamp { display: table; margin: 18px 6px 0 auto; padding: 4px 16px; border: 4px solid #c62828; color: #c62828; font-size: 34px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; transform: rotate(-12deg); opacity: 0.85; pointer-events: none; }
.dm-note { margin: 16px 0 0; font-size: 13px; color: #5c6283; }

/* Things bought */
.dm-bought h2, .dm-verse h2 { margin: 0; font-family: Georgia, serif; font-size: 32px; line-height: 1.2; }
.dm-intro { margin: 8px 0 22px; color: #b9bdd6; line-height: 1.5; }
.dm-bought ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 18px; }
.dm-bought li { padding: 16px 18px; background: #262d52; border-radius: 10px; }
.dm-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dm-name { font-weight: 900; font-size: 18px; }
.dm-year { font-weight: 400; font-size: 14px; color: #b9bdd6; margin-left: 4px; }
.dm-price { font-family: "Courier New", Courier, monospace; font-weight: 700; font-size: 17px; }
.dm-bar { margin: 10px 0; height: 12px; border-radius: 6px; background: #1d2340; overflow: hidden; }
.dm-bar span { display: block; width: var(--w); height: 100%; border-radius: 6px; background: #8a90b8; }
.dm-bought li p { margin: 0; font-size: 15px; line-height: 1.45; color: #d9dbea; }
.dm-bought li.dm-book { background: #fbf7ee; color: #1d2340; box-shadow: 0 0 0 3px #ec6e6a; }
.dm-book .dm-year, .dm-book p { color: #5c6283 !important; }
.dm-book .dm-bar { background: #e9e3d3; }
.dm-book .dm-bar span { background: #ec6e6a; }
.dm-book strong { color: #c62828; }
.dm-small { margin: 12px 0 0; font-size: 13px; color: #9ea3c4; }

/* The metaverse: a small CSS 3D room. --rx and --ry come from the mouse or the phone's tilt */
.dm-scene { position: relative; height: 380px; perspective: 900px; overflow: hidden; border-radius: 14px; background: radial-gradient(ellipse at 50% 40%, #3a4380, #141831 75%); }
.dm-room { --rx: -10deg; --ry: -22deg; position: absolute; left: 50%; top: 52%; width: 0; height: 0; transform-style: preserve-3d; transform: scale(var(--s, 1)) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform 0.4s ease-out; }
.dm-room > div { position: absolute; transform-style: preserve-3d; }
.dm-wall { width: 360px; height: 240px; margin: -120px 0 0 -180px; box-sizing: border-box; }
.dm-wall-back { transform: translateZ(-180px); background: linear-gradient(#6f78c4, #4d559c); }
.dm-wall-left { transform: rotateY(90deg) translateZ(-180px); background: linear-gradient(#5b63ad, #3e4688); display: flex; align-items: flex-start; justify-content: center; }
.dm-wall-right { transform: rotateY(-90deg) translateZ(-180px); background: linear-gradient(#5b63ad, #3e4688); }
.dm-floor { width: 360px; height: 360px; margin: -180px 0 0 -180px; transform: translateY(120px) rotateX(90deg); background-color: #2a3060;
	background-image: linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px); background-size: 40px 40px; }
.dm-sign-board { margin-top: 40px; padding: 8px 18px; background: #fbf7ee; color: #1d2340; font-family: Georgia, serif; font-weight: 700; font-size: 20px; border-radius: 4px; box-shadow: 0 4px 0 #1d2340; }
.dm-stand { width: 80px; height: 110px; margin: 10px 0 0 -40px; background: linear-gradient(#f3efe6, #c9c3b3); }
.dm-stand-top { position: absolute; left: 0; top: 0; width: 80px; height: 80px; transform-origin: top; transform: rotateX(90deg); background: #fbf7ee; }
.dm-book3d { position: absolute; left: -8px; bottom: 112px; width: 96px; height: 106px; overflow: hidden; box-shadow: 0 0 30px rgba(255, 240, 200, 0.6); }
.dm-book3d img { position: absolute; left: -95px; top: -48px; width: 242px; height: auto; }
.dm-avatar { width: 40px; height: 130px; margin: -10px 0 0 -130px; transform: translateZ(70px); display: flex; flex-direction: column; align-items: center; }
.dm-head { width: 30px; height: 30px; border-radius: 50%; background: #f1c9a5; }
.dm-body { width: 40px; height: 50px; margin-top: 4px; border-radius: 12px 12px 4px 4px; background: #ec6e6a; }
.dm-legs { width: 30px; height: 46px; background: linear-gradient(90deg, #1d2340 0 12px, transparent 12px 18px, #1d2340 18px); }

/* Like */
.dm-like { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px 24px; background: #262d52; border-radius: 14px; }
.dm-like-button { display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 24px; border: 2px solid #f3efe6; border-radius: 999px; background: none; color: #f3efe6; font: inherit; font-size: 18px; font-weight: 900; cursor: pointer; }
.dm-like-button:hover { background: rgba(255, 255, 255, 0.08); }
.dm-like-button[aria-pressed="true"] { border-color: #ec6e6a; background: #ec6e6a; color: #ffffff; }
.dm-like-count { margin: 0; font-size: 16px; line-height: 1.5; color: #d9dbea; }
.dm-like-count strong { font-size: 22px; color: #ffffff; }

/* Bottom */
.dm-bottom { max-width: 1000px; margin: 0 auto; padding: 64px 24px 48px; display: flex; flex-direction: column; gap: 28px; }
.dm-cta { background: #fbf7ee; color: #1d2340; padding: 40px 24px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.dm-cta h2 { margin: 0; font-size: 38px; line-height: 1.15; font-family: Georgia, serif; }
.dm-cta p { margin: 0; max-width: 560px; font-size: 17px; line-height: 1.5; }
.dm-cta-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; box-sizing: border-box; width: 100%; max-width: 560px; min-height: 72px; padding: 18px 24px; border-radius: 999px; background: #ec6e6a; color: #ffffff; font-size: 21px; font-weight: 900; text-transform: uppercase; text-decoration: none; }
.dm-cta-button:hover { background: #d95450; }
.dm-cta-arrow { display: inline-block; }
.dm-share { min-height: 48px; padding: 0 22px; border: 2px solid #1d2340; border-radius: 999px; background: none; color: #1d2340; font: inherit; font-size: 16px; font-weight: 900; cursor: pointer; }
.dm-share:hover { background: #1d2340; color: #ffffff; }
.dm-status { margin: 0; font-size: 14px; font-weight: 700; color: #2e7d32; }
.dm-status:empty { display: none; }
.dm-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; line-height: 1.5; color: #9ea3c4; border-top: 1px solid #3a4170; padding-top: 14px; }

@media (max-width: 600px) {
	main { padding: 0 16px; gap: 48px; }
	.dm-top { padding: 34px 16px 20px; }
	.dm-letter { padding: 34px 22px 30px 30px; font-size: 17px; }
	.dm-letter::before { left: 16px; }
	.dm-letter h1 { font-size: 32px; }
	.dm-invoice { padding: 22px 16px; }
	.dm-invoice h2 { font-size: 26px; }
	.dm-invoice table { font-size: 13px; }
	.dm-invoice th, .dm-invoice td { padding: 8px 3px; }
	.dm-stamp { font-size: 26px; }
	.dm-invoice thead { display: none; }
	.dm-invoice tr { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; border-bottom: 1px dashed #c3c6d6; }
	.dm-invoice th, .dm-invoice td { border: 0; }
	.dm-invoice tbody td:first-child { grid-column: 1 / -1; padding-bottom: 0; }
	.dm-invoice tbody td:nth-child(2) { text-align: left; color: #5c6283; }
	.dm-invoice tbody td:nth-child(2)::before { content: "Qty: "; }
	.dm-invoice tfoot tr { border-top: 3px double #1d2340; border-bottom: 0; }
	.dm-invoice tfoot th, .dm-invoice tfoot td { border: 0; font-size: 16px; }
	.dm-bought h2, .dm-verse h2 { font-size: 26px; }
	.dm-scene { height: 300px; }
	.dm-room { --s: 0.72; }
	.dm-bottom { padding: 48px 16px 40px; }
	.dm-cta h2 { font-size: 30px; }
	.dm-cta-button { font-size: 18px; min-height: 64px; }
}

/* Animations - only with JavaScript and when the visitor allows motion */
@media (prefers-reduced-motion: no-preference) {
	.js .dm-letter { animation: dm-unfold 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: top; }
	.js .dm-letter > * { animation: dm-write 0.5s ease both; }
	.js .dm-letter > *:nth-child(2) { animation-delay: 0.5s; }
	.js .dm-letter > *:nth-child(3) { animation-delay: 0.7s; }
	.js .dm-letter > *:nth-child(4) { animation-delay: 0.9s; }
	.js .dm-letter > *:nth-child(5) { animation-delay: 1.1s; }
	.js .dm-letter > *:nth-child(6) { animation-delay: 1.3s; }
	.js .dm-letter > *:nth-child(7) { animation-delay: 1.5s; }
	.js .dm-letter > *:nth-child(n+8) { animation-delay: 1.7s; }
	.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.45s ease, transform 0.45s ease; transition-delay: calc(var(--d, 0) * 90ms); }
	.js .reveal.is-in { opacity: 1; transform: none; }
	.js .reveal .dm-bar span { width: 0; transition: width 1.1s cubic-bezier(0.2, 0.8, 0.2, 1); transition-delay: calc(var(--d, 0) * 90ms + 0.2s); }
	.js .reveal.is-in .dm-bar span { width: var(--w); }
	.js .dm-invoice .dm-stamp { opacity: 0; transform: rotate(-12deg) scale(2.4); }
	.js .dm-invoice.is-in .dm-stamp { animation: dm-stamp 0.35s 0.6s cubic-bezier(0.3, 1.4, 0.5, 1) forwards; }
	.dm-book3d { animation: dm-float 3.2s ease-in-out infinite; }
	.dm-like-button.is-pop { animation: dm-pop 0.4s ease; }
	.dm-cta-button { animation: dm-glow 2.2s ease-in-out infinite; transition: transform 0.15s ease; }
	.dm-cta-button:hover { transform: scale(1.02); }
	.dm-cta-arrow { animation: dm-nudge 1.1s ease-in-out infinite; }
}
@media (prefers-reduced-motion: reduce) {
	.dm-room { transition: none; }
}

@keyframes dm-unfold { from { opacity: 0; transform: perspective(900px) rotateX(-30deg) translateY(-20px); } to { opacity: 1; transform: none; } }
@keyframes dm-write { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes dm-stamp { to { opacity: 0.85; transform: rotate(-12deg) scale(1); } }
@keyframes dm-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes dm-pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes dm-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(236, 110, 106, 0.5); } 50% { box-shadow: 0 0 0 12px rgba(236, 110, 106, 0); } }
@keyframes dm-nudge { 0%, 100% { transform: none; } 50% { transform: translateX(8px); } }
