.compact-letter{--letter-accent:#765d8b;background:radial-gradient(ellipse at 25% 45%,#675374,#2b2339 72%);color:#353237}
.compact-letter.teacher{--letter-accent:#8c6b44;background:radial-gradient(ellipse at 25% 45%,#9d8056,#342c23 72%)}
.compact-letter .story-nav{background:transparent;height:64px;border-bottom:1px solid #ffffff16}
.letter-view{height:100%;padding:88px 5vw 28px;display:grid;place-items:center;overflow:hidden}
.letter-card{position:relative;display:grid;grid-template-columns:.8fr 1.2fr;width:min(1020px,100%);height:min(650px,100%);min-height:0;background:#f5f0e4;box-shadow:0 30px 80px #0e061f40;isolation:isolate;animation:unfold-letter .7s cubic-bezier(.2,.75,.25,1) both}
.letter-picture{position:relative;min-height:0;overflow:hidden}.letter-picture img{width:100%;height:100%;object-fit:cover;object-position:68% center;transition:transform 1.4s}.letter-picture:hover img{transform:scale(1.045)}
.letter-picture-shade{position:absolute;inset:0;background:linear-gradient(0deg,#141b31cc,transparent 55%)}#letter-date{position:absolute;left:30px;top:24px;font-size:44px;font-weight:600;letter-spacing:-2px;color:#f9ead5;opacity:.8}#letter-caption{position:absolute;left:30px;right:20px;bottom:26px;font-size:7px;line-height:1.8;letter-spacing:1.5px;color:#f8e9d5}
.letter-sheet{position:relative;display:flex;flex-direction:column;justify-content:center;padding:38px 46px;background:radial-gradient(#9b86670d .8px,transparent .8px);background-size:5px 5px;min-height:0}
.letter-topline{display:flex;justify-content:space-between;align-items:center;color:#938378;font-size:8px;letter-spacing:1.5px}.letter-topline>span:last-child{font-size:24px;color:var(--letter-accent)}
.letter-sheet h2{font-size:clamp(26px,3.1vw,42px);font-weight:500;line-height:1.25;letter-spacing:-1.3px;margin:25px 0 24px}.letter-sheet h2 em{color:var(--letter-accent);letter-spacing:normal}
#letter-body p{font-size:13px;line-height:1.85;margin:0 0 14px;color:#655f5c}.letter-signature{display:grid;gap:5px;margin-top:9px}.letter-signature>span{font-size:10px;color:#8a7b70}.letter-signature>strong{font-family:var(--serif);font-size:26px;font-style:italic;font-weight:400;color:var(--letter-accent)}
.letter-actions{display:flex;gap:18px;margin-top:24px;align-items:center;flex-wrap:wrap}.letter-actions button{font-size:10px;padding:10px 0;color:#756056;border-bottom:1px solid #af97805c;min-height:40px}.letter-actions button:hover{color:#342339;border-color:currentColor}.letter-actions button:focus-visible{outline-color:var(--letter-accent);outline-offset:3px}
#letter-status{font-size:9px;line-height:1.5;color:var(--letter-accent);min-height:14px;margin:12px 0 0}
.letter-stamp-mark{position:absolute;right:36px;bottom:110px;width:86px;height:86px;border:2px solid #a15f76;border-radius:50%;color:#a15f76;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;transform:rotate(-14deg);opacity:.7;box-shadow:inset 0 0 0 4px #f5f0e4,inset 0 0 0 5px #a15f7677;pointer-events:none}.letter-stamp-mark[hidden]{display:none}.letter-stamp-mark>span{font-size:20px;font-weight:600}.letter-stamp-mark>b{font-size:8px;letter-spacing:1px}.teacher .letter-stamp-mark{border-color:#927042;color:#927042;box-shadow:inset 0 0 0 4px #f5f0e4,inset 0 0 0 5px #92704277}.stamped .letter-stamp-mark{animation:stamp-paper .45s ease-out both}
#letter-plane{position:absolute;left:55%;top:70%;width:60px;height:60px;pointer-events:none;opacity:0;z-index:9;filter:drop-shadow(3px 5px 4px #16101f40)}#letter-plane.flying{animation:letter-flight 2.6s ease-in-out both}
@keyframes unfold-letter{from{opacity:0;transform:perspective(1600px) rotateX(6deg) translateY(18px)}to{opacity:1;transform:none}}@keyframes stamp-paper{from{opacity:0;transform:scale(1.8) rotate(-25deg)}50%{opacity:.8;transform:scale(.95) rotate(-14deg)}to{opacity:.7;transform:scale(1) rotate(-14deg)}}@keyframes letter-flight{0%{opacity:0;transform:translate(0,0) rotate(12deg) scale(.5)}12%{opacity:1}45%{opacity:1;transform:translate(-18vw,-24vh) rotate(-30deg) scale(1)}75%{opacity:1;transform:translate(5vw,-45vh) rotate(35deg) scale(.8)}100%{opacity:0;transform:translate(48vw,-62vh) rotate(60deg) scale(.3)}}
@media(max-width:700px){.compact-letter .story-nav{height:56px}.letter-view{padding:72px 18px 18px}.letter-card{display:flex;flex-direction:column;width:min(480px,100%);height:100%;max-height:720px}.letter-picture{height:22%;min-height:80px;flex-shrink:0}.letter-picture img{object-position:65% 37%}.teacher .letter-picture img{object-position:50% 57%}.letter-picture-shade{background:linear-gradient(0deg,#141b3199,transparent)}#letter-date{font-size:34px;left:22px;top:13px}#letter-caption{left:22px;bottom:13px;font-size:6px;letter-spacing:1px}.letter-sheet{padding:22px 25px;flex:1;justify-content:center}.letter-topline{font-size:6px;letter-spacing:1.1px}.letter-topline>span:last-child{font-size:18px}.letter-sheet h2{font-size:30px;margin:17px 0 18px;letter-spacing:-.8px}#letter-body p{font-size:12px;line-height:1.75;margin-bottom:12px}.letter-signature{margin-top:4px}.letter-signature>strong{font-size:24px}.letter-actions{margin-top:18px;gap:22px}.letter-actions button{font-size:9px;padding:8px 0}.letter-stamp-mark{right:25px;bottom:108px;width:72px;height:72px}.letter-stamp-mark>span{font-size:17px}.letter-stamp-mark>b{font-size:7px}#letter-status{font-size:8px;margin-top:8px}#letter-plane{width:50px;height:50px;left:45%}}
@media(max-width:700px) and (max-height:730px){.letter-view{padding-top:66px;padding-bottom:12px}.letter-picture{height:16%;min-height:65px}.letter-sheet{padding:16px 22px}.letter-sheet h2{font-size:26px;margin:12px 0 14px}#letter-body p{font-size:11px;line-height:1.65;margin-bottom:10px}.letter-signature>strong{font-size:22px}.letter-actions{margin-top:10px}.letter-stamp-mark{bottom:96px}#letter-date{font-size:28px;top:6px}#letter-caption{bottom:9px}}
@media(max-height:520px){.letter-view{padding:58px 18px 12px}.compact-letter .story-nav{height:46px}.letter-card{display:grid;grid-template-columns:.6fr 1.4fr;height:100%}.letter-picture{height:auto;min-height:0}.letter-sheet{padding:15px 24px}.letter-topline{display:none}.letter-sheet h2{font-size:23px;margin:0 0 10px}#letter-body p{font-size:10px;line-height:1.6;margin-bottom:8px}.letter-signature{margin:0}.letter-signature>span{display:none}.letter-signature>strong{font-size:20px}.letter-actions{margin-top:5px}.letter-actions button{padding:5px 0;min-height:32px}#letter-status{margin:4px 0 0;font-size:8px}.letter-stamp-mark{right:25px;bottom:70px;width:58px;height:58px}.letter-stamp-mark>span{font-size:14px}}
@media(prefers-reduced-motion:reduce){.letter-card,.stamped .letter-stamp-mark{animation:none}#letter-plane.flying{animation:none;opacity:1;transform:rotate(15deg)}.letter-picture:hover img{transform:none}}
