/* The memory panel — the one place this page spends its boldness. */
.memory-panel {
    position: relative;
    margin: 0;
    padding: clamp(1.5rem, 3vw, 2.1rem);
    border-radius: var(--radius-lg);
    background: var(--surface-day);
    box-shadow: var(--membrane-day);
    overflow: hidden;
    isolation: isolate;
}

/* There was a watercolour behind the record. At 30%, hanging off the card's
   corner, two reviewers read it as an image that failed to load; whole and
   at 50%, the next two read it as body text printed over a picture. Either
   way it degraded the smallest paragraph on the page, and a record is a
   record: it reads better on plain parchment. The card's own lamp pool
   (::after) is the only light on it now. */
.memory-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 78% 82%, rgba(255, 243, 194, 0.75), transparent 58%);
    pointer-events: none;
}

/* One composition, always. As a wrapping flex row with space-between, whether
   the mood chip sat on its own line under the role or flush right on the
   role's own baseline was decided by about 5px of slack — so a 1440x900
   window and a 1440x700 window showed two different cards, and a longer
   character name or a webfont that failed to load would flip it the same way.
   The chip is a second line of the record; it belongs under the name. */
.memory-panel-head {
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--day-rule-soft);
}

/* The seal sits beside the name, not above it — a character and her mark are
   one object. The inner span keeps the name-over-role stack the panel had
   before the sigil arrived. */
.memory-who {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.memory-who > span {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.memory-who strong {
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.memory-role {
    font-size: var(--step--1);
    color: var(--day-ink-faint);
}

.memory-mood {
    display: inline-block;
    margin-top: 0.7rem;
    font-size: var(--step--1);
    font-weight: 700;
    color: var(--copper-ink);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--honey) 34%, transparent);
    white-space: nowrap;
}

.memory-title {
    margin: 1.2rem 0 0.9rem;
    font-size: var(--step--1);
    font-weight: 700;
    color: var(--day-ink-faint);
}

.memory-lines {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.memory-lines li {
    display: grid;
    gap: 0.15rem;
    padding-left: 1.15rem;
    position: relative;
}

.memory-lines li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--honey);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lantern) 60%, transparent);
}

.memory-when {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--day-ink-faint);
}

.memory-what {
    font-size: var(--step-0);
    line-height: 1.45;
    color: var(--day-ink);
}

/* The option she rejected, so the panel shows a decision rather than a log. */
.memory-weigh {
    margin-top: 1.1rem;
    font-size: var(--step--1);
    line-height: 1.5;
    color: var(--day-ink-faint);
}

.memory-foot {
    margin-top: 0.9rem;
    padding-top: 0.95rem;
    border-top: 1px solid var(--day-rule-soft);
    font-size: var(--step-0);
    font-style: italic;
    color: var(--copper-ink);
}

/* One orchestrated entrance, once, the first time the panel is actually on
   screen — not on load, which played it to nobody on a phone. Nothing else on
   the page moves unless a person asks it to.

   Held hidden until armed: otherwise a slow scroll shows the lines, then wipes
   them away, then writes them back. main.js adds the class immediately when
   IntersectionObserver is unavailable. */
.memory-panel:not(.is-remembering) .memory-lines li,
.memory-panel:not(.is-remembering) .memory-weigh,
.memory-panel:not(.is-remembering) .memory-foot {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .memory-panel:not(.is-remembering) .memory-lines li,
    .memory-panel:not(.is-remembering) .memory-weigh,
    .memory-panel:not(.is-remembering) .memory-foot {
        opacity: 1;
    }
}
/* One orchestrated entrance, once, the first time the panel is actually on
   screen — not on load, which played it to nobody on a phone. Nothing else on
   the page moves unless a person asks it to. */
.is-remembering .memory-lines li,
.is-remembering .memory-weigh,
.is-remembering .memory-foot {
    animation: remember 0.62s cubic-bezier(0.32, 0.72, 0.3, 1) backwards;
    /* 0.2s a line, not 0.42s. Three memories and a verdict took 2.3 seconds
       to finish writing; on a phone that is longer than a reader gives the
       first screen. The write-on is still a write-on — it just does not make
       the proof wait. */
    animation-delay: calc(0.15s + var(--i, 0) * 0.2s);
}

/* A write-on, not the stagger-and-fade-up every generated page uses: the line
   is wiped in from the left the way ink lands on a page. */
@keyframes remember {
    from {
        opacity: 0.15;
        clip-path: inset(0 100% 0 0);
    }
    to {
        opacity: 1;
        clip-path: inset(0 -2px 0 0);
    }
}


