/* ========== ABOUT PAGE — a letter pinned on the desk ========== */
/* Shares the notebook-desk design tokens from the home page. */

:root {
	--desk: #a8d4e6;
	--desk-mid: #9ccadd;
	--desk-dark: #82b8cf;
	--paper: #fdfcf7;
	--paper-edge: #f5f2e8;
	--line: #dcd9cc;
	--red-line: #d97070;
	--ink: #2a2a2a;
	--pencil: #7d7d7d;
	--pencil-light: #b3b3b3;
	--pink: #ffb7c5;
	--pink-deep: #ff8aa3;
	--accent-blue: #6ba9c4;
	--shadow: rgba(40, 50, 60, 0.18);
	--line-h: 34px;
	--surface-font: 'Comic Neue', 'LXGW WenKai GB Screen', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', 'Source Han Sans SC', 'Hiragino Sans GB', 'WenQuanYi Micro Hei', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--mono-font: 'JetBrains Mono', Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; min-height: 100%; }
html[data-sayori-i18n-pending] body { visibility: hidden; }

body {
	font-family: var(--surface-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--ink);
	background: var(--desk);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; border: none; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; color: inherit; }

/* ---------- desk backdrop (same recipe as home) ---------- */

.desk-surface {
	position: relative;
	min-height: 100vh;
	padding: clamp(1.2rem, 4vh, 3rem) clamp(0.75rem, 2vw, 1.5rem) clamp(4rem, 8vh, 6rem);
	background:
		radial-gradient(circle at 20% 30%, rgba(255,255,255,0.18), transparent 40%),
		radial-gradient(circle at 80% 70%, rgba(0,30,60,0.08), transparent 50%),
		repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,0.04) 3px 4px),
		repeating-linear-gradient(90deg, transparent 0 3px, rgba(0,0,0,0.025) 3px 4px),
		linear-gradient(160deg, #b4dced 0%, #92c4d8 55%, #a8d4e6 100%);
	display: flex;
	justify-content: center;
}

.desk-grain {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(circle at 24% 18%, rgba(255,255,255,0.16), transparent 32%),
		radial-gradient(circle at 76% 84%, rgba(0,30,60,0.1), transparent 44%);
	mix-blend-mode: soft-light;
}

/* ---------- the letter paper ---------- */

.letter-paper {
	position: relative;
	width: min(720px, 100%);
	margin-top: clamp(0.5rem, 2vh, 1.5rem);
	padding: clamp(2.6rem, 5vw, 3.6rem) clamp(1.6rem, 4.5vw, 3.2rem) clamp(2rem, 4vw, 3rem);
	background:
		linear-gradient(90deg, rgba(217,112,112,0.32) 0 2px, transparent 2px 100%),
		repeating-linear-gradient(180deg, transparent 0 calc(var(--line-h) - 1px), rgba(220,217,204,0.7) calc(var(--line-h) - 1px) var(--line-h)),
		linear-gradient(135deg, #fffdf8 0%, #f9f4e3 100%);
	background-position: clamp(1.6rem, 4vw, 2.6rem) 0, 0 clamp(2.6rem, 5vw, 3.6rem), 0 0;
	border-radius: 3px 7px 4px 6px;
	box-shadow: 0 30px 64px rgba(40,50,60,0.3), 0 2px 0 rgba(255,255,255,0.8) inset;
	transform: rotate(-0.7deg);
	animation: letterArrive 0.7s cubic-bezier(0.22, 0.78, 0.2, 1) both;
}

@keyframes letterArrive {
	from { opacity: 0; transform: translateY(4vh) rotate(-3.4deg) scale(0.97); }
	to { opacity: 1; transform: translateY(0) rotate(-0.7deg) scale(1); }
}

/* tape strip on top */
.letter-tape {
	position: absolute;
	top: -0.8rem;
	left: 50%;
	width: 9.5rem;
	height: 1.9rem;
	background: linear-gradient(90deg, rgba(255,240,200,0.2), rgba(255,240,200,0.78), rgba(255,240,200,0.24));
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	transform: translateX(-50%) rotate(-2.2deg);
	border-radius: 1px;
}

.letter-pin {
	position: absolute;
	top: -0.45rem;
	right: clamp(1.2rem, 4vw, 2.4rem);
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, var(--pink), var(--red-line));
	box-shadow: 0 2px 5px rgba(40,50,60,0.3);
}

/* back link sits on the desk, above the letter */
.desk-back {
	position: fixed;
	top: clamp(0.8rem, 2.4vh, 1.6rem);
	left: clamp(0.8rem, 2.4vw, 1.6rem);
	z-index: 10;
	display: inline-flex;
	align-items: center;
	min-height: 2.3rem;
	padding: 0.36rem 0.9rem;
	border: 1px solid rgba(217,112,112,0.62);
	border-radius: 999px;
	background: rgba(255,253,248,0.94);
	color: var(--red-line);
	box-shadow: 0 6px 18px rgba(40,50,60,0.18), 0 1px 0 rgba(255,255,255,0.86) inset;
	font-size: 0.94rem;
	font-weight: 700;
	transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.desk-back:hover,
.desk-back:focus-visible {
	background: rgba(255,238,242,0.97);
	border-color: rgba(217,112,112,0.92);
	box-shadow: 0 8px 22px rgba(217,112,112,0.24), 0 1px 0 rgba(255,255,255,0.9) inset;
	transform: translateY(-1px);
}

/* ---------- letter header ---------- */

.letter-head { margin-bottom: 1.6rem; }
.letter-kicker {
	font-size: 1rem;
	font-weight: 600;
	color: var(--red-line);
	margin-bottom: 0.35rem;
}
.letter-title {
	font-size: clamp(1.7rem, 4.5vw, 2.15rem);
	font-weight: 600;
	line-height: 1.28;
	margin-bottom: 0.75rem;
	color: #315d70;
}
.letter-stamp {
	display: inline-block;
	padding: 0.14rem 0.66rem;
	border: 1.5px dashed rgba(217,112,112,0.55);
	border-radius: 4px;
	color: var(--red-line);
	font-size: 0.84rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	transform: rotate(-1.6deg);
	background: rgba(255,247,248,0.6);
}
.letter-intro {
	margin-top: 0.9rem;
	font-size: 0.98rem;
	line-height: 1.75;
	color: rgba(42,42,42,0.78);
}

/* ---------- letter sections ---------- */

.letter-section { margin-top: 1.7rem; }
.letter-section h2 {
	position: relative;
	display: inline-block;
	font-size: 1.24rem;
	font-weight: 600;
	color: var(--red-line);
	margin-bottom: 0.55rem;
}
.letter-section h2::after {
	content: '';
	position: absolute;
	left: 0;
	right: -0.4rem;
	bottom: 0.02em;
	height: 0.34em;
	background: linear-gradient(90deg, rgba(255,183,197,0.42), rgba(255,183,197,0.14));
	z-index: -1;
	border-radius: 2px;
	transform: rotate(-0.6deg);
}
.letter-section p {
	font-size: 0.96rem;
	line-height: 1.8;
	color: rgba(42,42,42,0.84);
	margin-bottom: 0.7rem;
}
.letter-section p:last-child { margin-bottom: 0; }

.letter-code {
	display: block;
	margin: 0.55rem 0 0.75rem 0.4rem;
	padding: 0.42rem 0.8rem;
	font-family: var(--mono-font);
	font-size: 0.86rem;
	color: #315d70;
	background: rgba(168,212,230,0.16);
	border-left: 2px solid rgba(107,169,196,0.55);
	border-radius: 0 4px 4px 0;
	transform: rotate(0.3deg);
}

.letter-list-intro {
	font-size: 0.96rem;
	line-height: 1.8;
	color: rgba(42,42,42,0.84);
	margin-bottom: 0.4rem;
}
.letter-list { margin-top: 0.15rem; }
.letter-list li {
	position: relative;
	padding-left: 1.35rem;
	font-size: 0.95rem;
	line-height: 1.72;
	color: rgba(42,42,42,0.84);
	margin-bottom: 0.5rem;
}
.letter-list li::before {
	content: '✎';
	position: absolute;
	left: 0.1rem;
	top: 0;
	color: var(--pencil);
	font-size: 0.82rem;
	transform: rotate(-8deg);
}
.letter-list a,
.letter-section p a {
	color: #2f7ba0;
	text-decoration: underline wavy rgba(107,169,196,0.55) 1px;
	text-underline-offset: 3px;
	transition: color 0.18s ease;
}
.letter-list a:hover,
.letter-section p a:hover { color: var(--red-line); }

/* ---------- signature ---------- */

.letter-sign {
	margin-top: 2.1rem;
	text-align: right;
}
.letter-sign .sign-line {
	font-size: 1.06rem;
	font-weight: 600;
	color: rgba(42,42,42,0.86);
	transform: rotate(-1deg);
	display: inline-block;
}
.letter-ps {
	margin-top: 0.8rem;
	font-size: 0.88rem;
	line-height: 1.65;
	color: var(--pencil);
	transform: rotate(0.4deg);
}
.letter-ps a {
	color: #2f7ba0;
	text-decoration: underline wavy rgba(107,169,196,0.55) 1px;
	text-underline-offset: 3px;
}

/* ---------- FAQ ---------- */

.letter-faq { margin-top: 2.3rem; }
.letter-faq > h2 {
	position: relative;
	display: inline-block;
	font-size: 1.18rem;
	font-weight: 600;
	color: #315d70;
	margin-bottom: 0.6rem;
}
.letter-faq > h2::after {
	content: '';
	position: absolute;
	left: 0;
	right: -0.4rem;
	bottom: 0.02em;
	height: 0.34em;
	background: linear-gradient(90deg, rgba(168,212,230,0.42), rgba(168,212,230,0.12));
	z-index: -1;
	border-radius: 2px;
}
.letter-faq details {
	border: 1px dashed rgba(107,169,196,0.4);
	border-radius: 6px;
	background: rgba(255,255,255,0.4);
	padding: 0.6rem 0.9rem;
	margin-bottom: 0.55rem;
	transition: background 0.2s ease;
}
.letter-faq details[open] { background: rgba(255,255,255,0.66); }
.letter-faq summary {
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 600;
	color: rgba(42,42,42,0.88);
	list-style: none;
	position: relative;
	padding-left: 1.25rem;
}
.letter-faq summary::before {
	content: '?';
	position: absolute;
	left: 0;
	top: 0;
	color: var(--red-line);
	font-weight: 700;
	transition: transform 0.2s ease;
}
.letter-faq details[open] summary::before { transform: rotate(12deg) scale(1.1); }
.letter-faq summary::-webkit-details-marker { display: none; }
.letter-faq details p {
	margin-top: 0.45rem;
	font-size: 0.92rem;
	line-height: 1.7;
	color: rgba(42,42,42,0.78);
}

/* ---------- contact ---------- */

.letter-contact {
	margin-top: 2.2rem;
	padding-top: 1.2rem;
	border-top: 1px dashed rgba(217,112,112,0.4);
}
.letter-contact > h2 {
	font-size: 1.08rem;
	font-weight: 600;
	color: #315d70;
	margin-bottom: 0.7rem;
}
.contact-email {
	display: inline-block;
	margin-bottom: 0.85rem;
	font-family: var(--mono-font);
	font-size: 0.98rem;
	font-weight: 600;
	color: var(--red-line);
	border-bottom: 1.5px dashed rgba(217,112,112,0.5);
	padding-bottom: 0.1rem;
	cursor: pointer;
	transition: color 0.18s ease, border-color 0.18s ease;
}
.contact-email:hover { color: #b34f5e; border-color: #b34f5e; }
.contact-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.6rem;
}
.contact-links a {
	display: inline-flex;
	align-items: center;
	padding: 0.3rem 0.78rem;
	border: 1px solid rgba(107,169,196,0.5);
	border-radius: 999px;
	background: rgba(255,255,255,0.55);
	font-size: 0.88rem;
	font-weight: 600;
	color: #315d70;
	box-shadow: 0 2px 6px rgba(40,50,60,0.08);
	transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.contact-links a:hover,
.contact-links a:focus-visible {
	background: rgba(168,212,230,0.28);
	border-color: rgba(107,169,196,0.85);
	transform: translateY(-1px) rotate(-0.5deg);
}

/* ---------- footer ---------- */

.desk-foot {
	position: fixed;
	right: clamp(0.9rem, 2.4vw, 1.6rem);
	bottom: clamp(0.7rem, 2vh, 1.2rem);
	z-index: 10;
	font-size: 0.8rem;
	color: rgba(42,42,42,0.55);
	text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.desk-foot a { color: inherit; opacity: 0.85; }
.desk-foot a:hover { opacity: 1; text-decoration: underline; }

/* ---------- responsive & motion ---------- */

@media (max-width: 640px) {
	.letter-paper { transform: rotate(-0.4deg); }
	.letter-sign { text-align: left; }
	.desk-foot { position: static; text-align: center; margin-top: 1.6rem; text-shadow: none; }
	.desk-surface { padding-bottom: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
	.letter-paper { animation: none; }
	.desk-back, .contact-links a { transition: none; }
}
