/* ---------- letterbox ---------- */

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

.view {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px 26vh;
  animation: rise .7s var(--ease-soft) both;
}
.view[hidden] { display: none; }

.hand { font-family: var(--font-hand); font-weight: 700; letter-spacing: .01em; }
.title { font-size: clamp(2.6rem, 8vw, 4rem); margin: 0 0 4px; color: var(--peach-soft); text-shadow: 0 0 30px rgba(255, 200, 150, .25); }
.muted { color: var(--muted); margin: 0; }
.small { font-size: .88rem; }
.center { text-align: center; }

.back-home, .back {
  position: absolute;
  top: 22px; left: 22px;
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
}
.back-home:hover, .back:hover { color: var(--text); }

.link-btn {
  background: none; border: 0; padding: 4px 2px;
  color: var(--muted); font: inherit; cursor: pointer;
  text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px;
}
.link-btn:hover { color: var(--text); }

.btn {
  font: inherit; font-weight: 700;
  border: 0; border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform .25s var(--ease-bounce), box-shadow .25s, background .25s, opacity .2s;
}
.btn.primary {
  background: linear-gradient(180deg, #ffe0bd, var(--peach));
  color: var(--ink);
  box-shadow: 0 6px 18px -6px rgba(255, 190, 140, .6), inset 0 -2px 0 rgba(110, 52, 52, .15);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -6px rgba(255, 190, 140, .75), inset 0 -2px 0 rgba(110, 52, 52, .15); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

/* who are you */
.people {
  display: flex;
  gap: clamp(18px, 6vw, 56px);
  margin-top: 36px;
}
.person {
  display: grid;
  justify-items: center;
  gap: 10px;
  background: none; border: 0; padding: 0;
  color: var(--text); cursor: pointer;
  font-family: var(--font-hand); font-size: 2rem; font-weight: 700;
  animation: float 6s ease-in-out infinite;
}
.person:nth-child(2) { animation-delay: -3s; }
.person svg {
  width: clamp(120px, 30vw, 156px);
  height: auto;
  filter: drop-shadow(0 14px 22px rgba(10, 6, 25, .55));
  transition: transform .4s var(--ease-bounce), filter .4s;
}
.person:hover svg, .person:focus-visible svg {
  transform: translateY(-6px) rotate(-3deg) scale(1.05);
  filter: drop-shadow(0 18px 26px rgba(10, 6, 25, .6)) drop-shadow(0 0 22px rgba(255, 210, 160, .45));
}
.person:focus-visible { outline: none; }
.avatar-bg.myss { fill: #f6c9cf; }
.avatar-bg.dries { fill: #c9d8c1; }

/* password */
.pass-avatar svg { width: 96px; height: auto; margin-bottom: 8px; filter: drop-shadow(0 10px 18px rgba(10, 6, 25, .5)); }
.pass-form {
  display: flex; gap: 10px;
  margin-top: 26px;
  width: min(380px, 100%);
}
.pass-form input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 1.05rem;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 228, 200, .3);
  background: rgba(255, 245, 235, .08);
  color: var(--text);
  outline: none;
  transition: border-color .2s, background .2s;
}
.pass-form input:focus { border-color: var(--gold); background: rgba(255, 245, 235, .13); }
.pass-form input::placeholder { color: rgba(247, 236, 224, .4); }
.pass-form.shake { animation: shake .45s; }

.tries { display: flex; gap: 10px; margin-top: 18px; }
.tries i {
  width: 12px; height: 12px;
  background: var(--gold);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  transition: opacity .4s, transform .4s;
}
.tries i.used { opacity: .18; transform: scale(.7); }
.pass-msg { min-height: 1.4em; margin: 12px 0 0; color: var(--peach-soft); }

/* desk */
.desk {
  justify-content: flex-start;
  align-items: stretch;
  text-align: left;
  max-width: 1040px;
  margin: 0 auto;
  padding-top: 28px;
}
.desk-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.desk-title { display: flex; align-items: center; gap: 14px; }
.desk-title h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.6rem); line-height: 1; color: var(--peach-soft); }
.home-link img { display: block; border-radius: 12px; box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .5); transition: transform .3s var(--ease-bounce); }
.home-link:hover img { transform: rotate(-6deg) scale(1.06); }
.desk-actions { display: flex; align-items: center; gap: 16px; }

.tabs {
  display: flex; gap: 6px;
  margin: 26px 0 14px;
  padding: 5px;
  background: rgba(255, 240, 225, .07);
  border: 1px solid rgba(255, 228, 200, .12);
  border-radius: 999px;
  width: max-content; max-width: 100%;
}
.tab {
  font: inherit; font-weight: 600;
  background: none; border: 0; color: var(--muted);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  transition: background .25s, color .25s;
  display: inline-flex; align-items: center; gap: 8px;
}
.tab[aria-selected="true"] { background: rgba(255, 228, 200, .16); color: var(--text); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: var(--pink); color: var(--ink);
  font-size: .75rem; display: inline-grid; place-items: center;
}
.badge[hidden] { display: none; }

.transit {
  margin: 4px 0 16px;
  color: var(--gold);
  font-family: var(--font-hand); font-size: 1.35rem;
  display: flex; align-items: center; gap: 10px;
}
.transit[hidden] { display: none; }
.transit::before {
  content: ""; width: 34px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold));
  animation: comet 2.4s ease-in-out infinite;
}

.panel { animation: rise .5s var(--ease-soft) both; }

.letters {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}
.letter-card {
  width: 100%;
  display: grid; justify-items: center; gap: 2px;
  padding: 12px 14px 16px;
  font: inherit; color: var(--text); text-align: center;
  background: rgba(255, 242, 228, .06);
  border: 1px solid rgba(255, 228, 200, .12);
  border-radius: 22px;
  cursor: pointer;
  transition: transform .35s var(--ease-bounce), background .3s, border-color .3s;
  animation: rise .6s var(--ease-soft) both;
}
.letter-card:hover, .letter-card:focus-visible {
  transform: translateY(-4px) rotate(-1deg);
  background: rgba(255, 242, 228, .11);
  border-color: rgba(255, 228, 200, .26);
}
.letter-card img { width: 128px; height: 128px; object-fit: contain; margin: -8px 0 -14px; filter: drop-shadow(0 8px 12px rgba(10, 6, 25, .45)); }
.letter-card .when { font-family: var(--font-hand); font-size: 1.35rem; color: var(--peach-soft); }
.letter-card .peek {
  font-family: var(--font-letter); font-weight: 300; font-size: .9rem;
  color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em; margin: 2px 0 0;
}
.letter-card .tag {
  margin-top: 6px;
  font-size: .76rem; font-weight: 700; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 228, 200, .12); color: var(--muted);
}
.letter-card.unopened { border-color: rgba(255, 210, 160, .4); }
.letter-card.unopened img { animation: wiggle 3.2s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(255, 210, 160, .55)); }
.letter-card.unopened .tag { background: var(--pink); color: var(--ink); }
.letter-card.travelling { border-style: dashed; }
.letter-card.travelling img { opacity: .7; }
.letter-card.travelling .tag { background: rgba(255, 217, 168, .18); color: var(--gold); }
.letter-card.read-tag .tag { background: rgba(163, 184, 160, .25); color: #d6e6cf; }

.empty {
  text-align: center;
  font-family: var(--font-hand); font-size: 1.6rem;
  color: var(--muted);
  padding: 40px 0;
}

/* our sky */
.starmap {
  position: relative;
  height: min(56vh, 520px);
  border-radius: 28px;
  background:
    radial-gradient(60% 50% at 30% 30%, rgba(160, 140, 220, .12), transparent 70%),
    radial-gradient(50% 40% at 75% 70%, rgba(244, 182, 194, .1), transparent 70%),
    rgba(10, 8, 26, .45);
  border: 1px solid rgba(255, 228, 200, .12);
  overflow: hidden;
}
.starlines { position: absolute; inset: 0; width: 100%; height: 100%; }
.starlines line { stroke: rgba(255, 228, 200, .22); stroke-width: 1; stroke-dasharray: 3 5; }
.letter-star {
  position: absolute;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.letter-star::before {
  content: "";
  width: var(--s, 12px); height: var(--s, 12px);
  background: var(--c, #fff);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 6px var(--c, #fff));
  animation: twinkle-star var(--d, 3s) ease-in-out infinite;
  transition: transform .3s var(--ease-bounce);
}
.letter-star::after {
  content: "";
  position: absolute;
  width: calc(var(--s, 12px) * 2.6); height: calc(var(--s, 12px) * 2.6);
  border-radius: 50%;
  background: radial-gradient(circle, var(--c, #fff), transparent 65%);
  opacity: .28;
}
.letter-star:hover::before, .letter-star:focus-visible::before { transform: scale(1.6) rotate(20deg); }
.letter-star.myss { --c: #f6bccb; }
.letter-star.dries { --c: #ffdcab; }
.letter-star.travel::before { opacity: .45; animation-duration: 1.4s; }
.letter-star.unread::before { animation: twinkle-star 1.1s ease-in-out infinite; }
.letter-star:focus-visible { outline: none; }

.star-tip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 22px));
  background: rgba(251, 241, 227, .95); color: var(--ink);
  border-radius: 12px; padding: 6px 12px;
  font-size: .85rem; font-weight: 600; white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .5);
}
.star-tip[hidden] { display: none; }

.sky-legend { display: flex; gap: 20px; justify-content: center; margin: 14px 0 6px; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.sky-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dot.myss { background: #f6bccb; box-shadow: 0 0 8px #f6bccb; }
.dot.dries { background: #ffdcab; box-shadow: 0 0 8px #ffdcab; }
.dot.travel { background: transparent; border: 1.5px dashed var(--gold); }

/* soft paper behind the hand-drawn envelopes (their insides are see-through) */
img[src$="letter_unopened.png"] { background: url("/assets/env-back-closed.svg") center / 100% 100% no-repeat; }
img[src$="letter_opened.png"] { background: url("/assets/env-back-open.svg") center / 100% 100% no-repeat; }

/* ---------- overlays ---------- */

.overlay {
  position: fixed; inset: 0;
  z-index: 10;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(12, 9, 26, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .4s ease both;
  overflow-y: auto;
}
.overlay[hidden] { display: none; }
.overlay.closing { animation: fade-out .3s ease both; }

/* arrival */
.arrival { text-align: center; background: rgba(12, 9, 26, .72); }
.arrival-inner { display: grid; justify-items: center; gap: 8px; }
.arrival-kicker { color: var(--gold); letter-spacing: .6em; margin: 0; animation: rise .8s .2s var(--ease-soft) both; }
.arrival-title {
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  line-height: 1.05;
  margin: 4px 0 0;
  color: var(--peach-soft);
  text-shadow: 0 0 40px rgba(255, 200, 150, .4);
  max-width: 14ch;
}
.arrival-title .word { display: inline-block; animation: word-in .8s var(--ease-bounce) both; }
.arrival-envelope {
  position: relative;
  background: none; border: 0; padding: 0; cursor: pointer;
  margin-top: 6px;
  animation: drop-in 1.3s .5s var(--ease-soft) both;
}
.arrival-envelope img {
  position: relative;
  width: clamp(200px, 50vw, 300px); height: auto; display: block;
  animation: bob 3.4s 1.8s ease-in-out infinite;
  filter: drop-shadow(0 20px 26px rgba(0, 0, 0, .45));
  transition: transform .35s var(--ease-bounce);
}
.arrival-envelope:hover img { transform: scale(1.05) rotate(-2deg); }
.env-glow {
  position: absolute; inset: 12% 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 160, .55), transparent 70%);
  filter: blur(12px);
  animation: glow 2.6s ease-in-out infinite;
}
.arrival-hint { animation: fade 1s 1.8s both; }
.arrival-envelope:focus-visible { outline: none; }
.arrival-envelope:focus-visible img { transform: scale(1.04); }

/* opening */
.opening { background: rgba(12, 9, 26, .72); }
.open-stage { position: relative; width: clamp(220px, 54vw, 320px); aspect-ratio: 1; }
.open-stage .env { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 20px 26px rgba(0, 0, 0, .45)); }
.open-stage .env-open { opacity: 0; }
.mini-paper {
  position: absolute;
  left: 24%; right: 24%; top: 34%; height: 40%;
  background: var(--cream);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  background-image: repeating-linear-gradient(180deg, transparent 0 13px, rgba(110, 52, 52, .12) 13px 14px);
  opacity: 0;
}
.opening.play .env-closed { animation: shake-env .6s ease-in-out, vanish .01s .6s forwards; }
.opening.play .env-open { animation: pop-open .45s .6s var(--ease-bounce) forwards, env-away .55s 1.45s var(--ease-soft) forwards; }
.opening.play .mini-paper { animation: paper-up 1s .95s var(--ease-soft) forwards; }

/* paper (reader + compose) */
.paper {
  position: relative;
  width: min(680px, 100%);
  margin: auto;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(120% 80% at 0% 0%, rgba(242, 196, 155, .35), transparent 50%),
    radial-gradient(100% 70% at 100% 100%, rgba(163, 184, 160, .25), transparent 50%);
  border-radius: 10px 14px 12px 8px;
  padding: clamp(26px, 5vw, 52px) clamp(22px, 6vw, 60px) clamp(22px, 4vw, 36px);
  box-shadow:
    0 2px 0 rgba(110, 52, 52, .08),
    0 30px 60px -20px rgba(0, 0, 0, .6),
    inset 0 0 60px rgba(201, 150, 110, .18);
  animation: unfold .7s var(--ease-soft) both;
  transform-origin: 50% 80%;
}
.paper::after { /* faint paper grain */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: radial-gradient(rgba(110, 52, 52, .07) 1px, transparent 1.2px);
  background-size: 7px 7px;
  mix-blend-mode: multiply;
}
.close {
  position: absolute; top: 10px; right: 14px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: rgba(110, 52, 52, .08);
  color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; z-index: 2;
  transition: background .2s, transform .3s var(--ease-bounce);
}
.close:hover { background: rgba(110, 52, 52, .16); transform: rotate(90deg); }
.paper-head { margin-bottom: 12px; position: relative; z-index: 1; }
.paper-from { font-size: clamp(1.9rem, 5vw, 2.4rem); margin: 0; line-height: 1.1; }
.paper-date { margin: 4px 0 0; font-size: .86rem; color: var(--ink-soft); opacity: .85; }
.reply-ref { color: var(--ink-soft); font-size: .86rem; padding-left: 0; }
.reply-ref:hover { color: var(--ink); }

.paper-body, .paper-write {
  font-family: var(--font-letter);
  font-weight: 300;
  font-size: clamp(1.08rem, 2.6vw, 1.22rem);
  line-height: 2rem;
  color: #5a2b2b;
  background-image: repeating-linear-gradient(180deg, transparent 0 calc(2rem - 1px), rgba(110, 52, 52, .14) calc(2rem - 1px) 2rem);
  background-position: 0 .35rem;
  position: relative; z-index: 1;
}
.paper-body { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 6rem; }
.paper-body .line { animation: ink-in .6s var(--ease-soft) both; display: block; min-height: 2rem; }
.paper-write {
  display: block; width: 100%;
  min-height: 14rem;
  border: 0; outline: none; resize: none;
  background-color: transparent;
  padding: 0;
  caret-color: var(--ink);
  overflow: hidden;
}
.paper-write::placeholder { color: rgba(110, 52, 52, .4); }

.paper-doodle {
  display: block; max-width: 100%;
  margin: 14px auto 0;
  position: relative; z-index: 1;
  animation: ink-in .8s .3s var(--ease-soft) both;
}
.paper-doodle[hidden] { display: none; }

.paper-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 22px; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.paper-status { margin: 0; font-size: .86rem; color: var(--ink-soft); }
.paper .btn.primary { background: var(--ink); color: var(--cream); box-shadow: 0 8px 18px -8px rgba(110, 52, 52, .8); }
.paper .btn.primary:hover { background: #7f3d3d; }
.paper .link-btn { color: var(--ink-soft); }
.paper .link-btn:hover { color: var(--ink); }

/* compose extras */
.compose-tools { margin-top: 8px; position: relative; z-index: 1; }
.doodle-wrap { margin-top: 14px; position: relative; z-index: 1; }
.doodle-wrap[hidden] { display: none; }
#doodle {
  display: block; width: 100%; aspect-ratio: 2 / 1;
  border-radius: 12px;
  border: 1.5px dashed rgba(110, 52, 52, .3);
  background: rgba(255, 255, 255, .35);
  touch-action: none; cursor: crosshair;
}
.doodle-tools { display: flex; align-items: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.inks { display: flex; gap: 8px; }
.ink {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .8);
  box-shadow: 0 0 0 1px rgba(110, 52, 52, .25);
  cursor: pointer; padding: 0;
  transition: transform .2s var(--ease-bounce);
}
.ink.on { transform: scale(1.2); box-shadow: 0 0 0 2px var(--ink); }

.delivery {
  border: 0; padding: 0; margin: 20px 0 0;
  position: relative; z-index: 1;
}
.delivery legend { font-family: var(--font-hand); font-size: 1.45rem; font-weight: 700; padding: 0; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-block;
  padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid rgba(110, 52, 52, .25);
  font-size: .9rem; font-weight: 600;
  transition: background .2s, color .2s, border-color .2s;
}
.chips input:checked + span { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.chips input:focus-visible + span { outline: 2px dashed var(--ink); outline-offset: 3px; }
#when-pick {
  margin-top: 10px;
  font: inherit; color: var(--ink);
  padding: 7px 12px; border-radius: 10px;
  border: 1.5px solid rgba(110, 52, 52, .25);
  background: rgba(255, 255, 255, .5);
}
#when-pick[hidden] { display: none; }
.when-note { margin: 8px 0 0; font-size: .86rem; color: var(--ink-soft); min-height: 1.2em; }

/* sending */
.sending { background: rgba(12, 9, 26, .45); }
.sending .fly { width: clamp(180px, 40vw, 260px); filter: drop-shadow(0 20px 26px rgba(0, 0, 0, .45)); }
.sending.play .fly { animation: fly-away 1.6s var(--ease-soft) forwards; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 20;
  transform: translateX(-50%);
  background: rgba(251, 241, 227, .96); color: var(--ink);
  padding: 12px 22px; border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .55);
  animation: toast-in .5s var(--ease-bounce) both;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast[hidden] { display: none; }

/* ---------- keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes wiggle { 0%, 86%, 100% { transform: rotate(0); } 89% { transform: rotate(-5deg); } 93% { transform: rotate(4deg); } 96% { transform: rotate(-2deg); } }
@keyframes comet { 0%, 100% { transform: translateX(-6px); opacity: .5; } 50% { transform: translateX(4px); opacity: 1; } }
@keyframes twinkle-star { 0%, 100% { opacity: .75; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes word-in { from { opacity: 0; transform: translateY(18px) rotate(-4deg); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes drop-in {
  0% { opacity: 0; transform: translateY(-60vh) rotate(-24deg) scale(.6); }
  60% { opacity: 1; transform: translateY(12px) rotate(6deg) scale(1.02); }
  80% { transform: translateY(-6px) rotate(-2deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(1.5deg); } }
@keyframes glow { 0%, 100% { opacity: .6; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes shake-env { 0%, 100% { transform: none; } 20% { transform: rotate(-6deg); } 45% { transform: rotate(5deg); } 70% { transform: rotate(-3deg); } }
@keyframes vanish { to { opacity: 0; } }
@keyframes pop-open { 0% { opacity: 0; transform: scale(.94); } 100% { opacity: 1; transform: scale(1); } }
@keyframes env-away { to { opacity: 0; transform: translateY(40%) scale(.9); } }
@keyframes paper-up {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  50% { opacity: 1; transform: translateY(-115%) scale(1); }
  70% { opacity: 1; transform: translateY(-105%) scale(1.15); }
  100% { opacity: 0; transform: translateY(-60%) scale(2.4); }
}
@keyframes unfold { from { opacity: 0; transform: translateY(30px) scaleY(.82) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
@keyframes ink-in { from { opacity: 0; filter: blur(3px); transform: translateY(4px); } to { opacity: 1; filter: none; transform: none; } }
@keyframes fly-away {
  0% { transform: scale(.4) rotate(0); opacity: 0; }
  18% { transform: scale(1) rotate(-3deg); opacity: 1; }
  38% { transform: scale(1) rotate(2deg); opacity: 1; }
  100% { transform: translate(34vw, -60vh) scale(.04) rotate(40deg); opacity: 0; }
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 560px) {
  .desk-head { align-items: flex-start; }
  .desk-actions { width: 100%; justify-content: space-between; }
  .letters { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .letter-card img { width: 100px; height: 100px; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 8px 6px; }
  .overlay { padding: 10px; align-items: start; }
  .paper { margin-top: 10px; }
}
