/* =====================================================================
   letters.css — the look of sky/letters.js.
   (it used to be written inside the script, as strings; same rules, now here)
   ===================================================================== */

body.has-letter-paper .sheet {
    background: var(--letter-paper) center / 100% 100% no-repeat;
}
body.has-ink-blot .marks .blot,
body.has-ink-star .marks .star {
    background: center / contain no-repeat;
}
body.has-ink-blot .marks .blot {
    background-image: var(--ink-blot);
}
body.has-ink-blot .marks .blot use {
    display: none;
}
body.has-ink-star .marks .star {
    background-image: var(--ink-star);
}
body.has-ink-star .marks .star use {
    display: none;
}

.letter-open,
.letters-view {
    position: fixed;
    inset: 0;
    z-index: 8;
    overflow-y: auto;
    overscroll-behavior: contain;
    overflow-anchor: none;
    touch-action: pan-y pinch-zoom;
    visibility: hidden;
    opacity: 0;
    transition: opacity .45s, visibility 0s .45s;
}
.letter-open.open,
.letters-view.open {
    visibility: visible;
    opacity: 1;
    transition: opacity .45s;
}
.letter-open {
    background: radial-gradient(ellipse at 50% 42%, rgba(18, 22, 32, .3), rgba(8, 10, 16, .72) 80%);
}
.letters-view {
    background: rgba(12, 16, 24, .84);
}
.lo-inner,
.lv-list {
    box-sizing: border-box;
    padding: 74px 16px 60px;
}
/* (on a touch screen, always a pixel more than the screen: with nothing to scroll a finger's drag goes straight through to the page behind, and a
   letter whose video hasn't said its shape yet is short until it does) */
@media (pointer: coarse) {
    .lo-inner,
    .lv-list { min-height: calc(100% + 1px); }
}
/* (and the page behind stays put while a letter's being read) */
html:has(body.letter-reading),
body.letter-reading {
    overflow: hidden;
}
.letter-open .letter,
.letters-view .letter {
    margin: 0 auto 70px;
}
.lo-close,
.lv-close {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 3;
    border: 0;
    cursor: pointer;
    padding: 8px 18px;
    border-radius: 999px;
    font: italic 1.05rem "IM Fell English", Georgia, serif;
    background: #3a2716;
    color: #f3e6c2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .45);
}
.lo-close:hover,
.lv-close:hover {
    background: #9a3b1f;
}
.lv-title {
    text-align: center;
    margin: 0 0 34px;
    font: normal 1.8rem "IM Fell English SC", Georgia, serif;
    color: #f3e6c2;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .6);
}
body.letter-reading .signpost,
body.letter-reading .post-btn,
body.letter-reading .cp {
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.flying-scroll {
    z-index: 9 !important;
}
.letters[hidden] {
    display: none;
}
.letters-btn {
    left: 18px;
    top: 18px;
    bottom: auto;
}
body.letter-reading .letters-btn,
body.post-open .letters-btn,
body.sky-view .letters-btn {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ---------- a record falling out of a letter (letters.js fallOut: a song "→ record player") ----------
   the record leaves its sleeve in the letter (.fallen: the sleeve stays, empty), drops off the bottom of the screen spinning,
   and a word comes up at the foot of the screen: what it was, and that it's in the record player now */
.em-song.kept .es-disc { visibility: hidden; }          /* (its record is in their record player now: the sleeve is empty) */
.em-song.fallen .es-record { cursor: default; }
/* a record that's theirs: its button plays it on the site's record player, so the letter's own seek bar and clock step aside */
.em-song.kept .es-seek, .em-song.kept .es-time { display: none; }
.falling-record {
    position: fixed;
    z-index: 2147482000;
    pointer-events: none;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .45));
}
.falling-record svg { display: block; width: 100%; height: 100%; }
.record-landed {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 2147482001;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: min(440px, calc(100vw - 32px));
    padding: 10px 20px 10px 12px;
    border-radius: 999px;
    background: rgba(20, 14, 10, .94);
    border: 1px solid rgba(243, 230, 194, .3);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .55);
    color: #f3e6c2;
    font: italic 1rem/1.3 "IM Fell English", Georgia, serif;
    transform: translate(-50%, 160%);
    transition: transform .6s cubic-bezier(.3, .7, .3, 1.2);
    cursor: pointer;
}
.record-landed.in { transform: translate(-50%, 0); }
.record-landed .rl-disc { flex: none; width: 54px; height: 54px; }
.record-landed .rl-disc svg { display: block; width: 100%; height: 100%; animation: rl-spin 1.8s linear infinite; }
@keyframes rl-spin { to { transform: rotate(360deg); } }
.record-landed .rl-words { display: flex; flex-direction: column; min-width: 0; }
.record-landed b { font: normal 1.15rem "IM Fell English SC", Georgia, serif; color: #f6dd8e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-landed small { font-size: .82rem; opacity: .8; }
@media (prefers-reduced-motion: reduce) { .record-landed .rl-disc svg { animation: none; } }
