/* ═══════════════════════════════════════════
   letter-reveal — the emotional centre.
   Cream-parchment, no sparkles. Tap-to-reveal
   clause by clause, then a signed close.
   ═══════════════════════════════════════════ */

.letter-reveal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 5vw, 3rem);
    background: var(--bg-primary);
    overflow: hidden;
    /* Tapping the container (background or parchment) advances the letter
       -- see the click listener in js/letter-reveal.js. There is no
       covering overlay any more, so this cursor is the visual affordance
       that used to come from the full-bleed tap-target button. */
    cursor: pointer;
}

/* Very faint warm glow behind the parchment — the "breath" ambient. */
.letter-reveal-glow {
    position: absolute;
    inset: -12%;
    z-index: 0;
    /* --bloom: the accent-derived glow is darker than a light ground and
       banded behind the parchment. */
    background: radial-gradient(closest-side at 50% 45%, var(--bloom), transparent);
    filter: blur(48px);
    animation: letter-reveal-glowBreathe 6400ms var(--ease-breath) infinite;
    pointer-events: none;
}

.letter-reveal-parchment {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    /* The 1200-char "maximum" letter renders well past the container's
       height (measured 1710px inside an 812px-tall viewport). Scroll the
       parchment itself rather than let it clip -- birthday-romance's
       .scroll-parchment (css/loveletter.css) solves the same problem the
       same way. */
    max-height: 82vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    box-shadow: 0 24px 64px rgba(42, 40, 32, 0.14);
    padding: clamp(1.75rem, 6vw, 3rem);
    text-align: left;
}

.letter-reveal-parchment::-webkit-scrollbar { width: 4px; }
.letter-reveal-parchment::-webkit-scrollbar-track { background: transparent; }
.letter-reveal-parchment::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }

.letter-reveal-salutation {
    margin: 0 0 1.25rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.3rem, 4vw, 1.7rem);
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.letter-reveal-name {
    color: var(--accent-warm-deep);
}

.letter-reveal-body {
    min-height: 3.5rem;
    font-family: var(--font-script);
    font-size: clamp(1.4rem, 4.5vw, 1.9rem);
    line-height: 1.65;
    color: var(--text-primary);
}

.letter-reveal-clause {
    display: inline;
    animation: letter-reveal-fadeIn 600ms var(--ease-expo-out) both;
}

.letter-reveal-signature {
    display: none;
    margin: 2rem 0 0;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: right;
}

.letter-reveal-signature.letter-reveal-signature--visible {
    display: block;
    animation: letter-reveal-fadeIn 800ms var(--ease-expo-out) both;
}

/* .letter-reveal-cue is a real <button> (see html/letter-reveal.html) so
   keyboard/assistive-tech users have an explicit, always-reachable way to
   advance the letter -- reset the native button chrome so it still reads
   as the plain chevron cue it always was. */
/* Once the letter is signed, the cue says what it does. A bare
   down-chevron read as "scroll", so the letter could look like the end. */
.letter-reveal-cue-label {
    display: none;
    margin-left: 0.6rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.letter-reveal-cue.letter-reveal-cue--done .letter-reveal-cue-label {
    display: inline;
}

/* The buyer's letter already opens with a greeting, so ours stands down. */
.letter-reveal-salutation.letter-reveal-salutation--suppressed {
    display: none;
}

.letter-reveal-cue {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 1.5rem 0 0;
    padding: 0;
    background: transparent;
    border: none;
    appearance: none;
    font: inherit;
    cursor: pointer;
    opacity: 1;
    transition: opacity 300ms var(--ease-silk);
}

.letter-reveal-cue.letter-reveal-cue--hidden {
    opacity: 0;
    pointer-events: none;
}

.letter-reveal-cue:focus-visible {
    outline: 2px solid var(--accent-warm);
    outline-offset: 2px;
    border-radius: 4px;
}

.letter-reveal-chevron {
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--accent-warm-deep);
    border-bottom: 2px solid var(--accent-warm-deep);
    transform: rotate(45deg);
    animation: letter-reveal-chevronPulse 1600ms var(--ease-breath) infinite;
}

@keyframes letter-reveal-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes letter-reveal-glowBreathe {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.06); }
}

@keyframes letter-reveal-chevronPulse {
    0%, 100% { opacity: 0.35; transform: rotate(45deg) translate(0, 0); }
    50% { opacity: 1; transform: rotate(45deg) translate(3px, 3px); }
}

/* ───── Eyebrow — the one line that locks this screen to graduation ───── */
.letter-reveal-eyebrow {
    margin: 0 0 0.9rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.85;
}
