/* Session 74/75 — the sign-off card (finale.js). Same material as #story: real
   liquid glass from glassify.js sets backdrop-filter inline, so nothing here
   may set it. Sits above #storyVeil (90) / #story (91). */
#finaleVeil {
  position: fixed; inset: 0; z-index: 300;
  background: radial-gradient(120% 90% at 50% 45%, rgba(10,12,18,.22), rgba(8,10,14,.62));
  opacity: 0; visibility: hidden;
  transition: opacity .6s ease, visibility .6s;
}
#finaleVeil.show { opacity: 1; visibility: visible; }
#finaleVeil.solid { background: #10131a; opacity: 1; transition: opacity .45s ease; }
#finaleConfetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 302; pointer-events: none; }

#finale {
  position: fixed; left: 50%; top: 50%; z-index: 301;
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain;
  /* no bottom padding: she stands on the card's bottom edge (see .finalePhoto) */
  padding: 30px 32px 0; border-radius: 22px;
  background: linear-gradient(168deg, rgba(16,19,26,.34), rgba(16,19,26,.52));
  border: 1px solid rgba(255,226,138,.30);
  box-shadow:
    0 22px 50px rgba(0,0,0,.40),
    inset 0 1px 1px rgba(255,255,255,.34),
    inset 0 -10px 22px rgba(255,255,255,.05),
    inset 0 0 0 1px rgba(255,255,255,.11);
  text-shadow: 0 1px 10px rgba(0,0,0,.5);
  color: var(--ink);
  text-align: left;
  opacity: 0; visibility: hidden;
  transform: translate(-50%, calc(-50% + 16px));
  transition: opacity .5s ease, transform .5s ease, visibility .5s;
}
#finale.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }

/* Two faces, mixed: Bitcount Grid (primary) for the lines that should feel
   like the house's own lettering, Coda (secondary) for the plain talking. */
#finale .ln { display: inline; }
#finale .ln.major { font-family: var(--font-major); letter-spacing: .01em; }
#finale .ln.body  { font-family: var(--font-body); }

#finale p { margin: 0 0 14px; font-size: 16.5px; line-height: 1.6; }
#finale .lead { font-size: 23px; line-height: 1.25; margin-bottom: 16px; }

/* The quote is marked with the house star (the navbar's sparkle) instead of a
   rule: a pair opens it, a pair closes it. */
#finale .quote {
  position: relative; margin: 8px 0 20px; padding: 24px 42px 22px 4px;
  font-size: 19px; line-height: 1.45;
}
#finale .quote::before, #finale .quote::after {
  content: ''; position: absolute; width: 40px; height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 22'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='.75' y2='1'%3E%3Cstop offset='0' stop-color='%23fff6cf'/%3E%3Cstop offset='.5' stop-color='%23ffd166'/%3E%3Cstop offset='1' stop-color='%23f0a713'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='url(%23g)'%3E%3Cpath d='M10 1Q10 11 20 11Q10 11 10 21Q10 11 0 11Q10 11 10 1Z'/%3E%3Cpath d='M30 3Q30 11 38 11Q30 11 30 19Q30 11 22 11Q30 11 30 3Z' transform='translate(-1 0)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 1px 6px rgba(255,190,70,.45));
}
#finale .quote::before { left: 0; top: 0; }
#finale .quote::after  { right: 0; bottom: 0; transform: rotate(180deg); }

/* lines arrive one after another once the card is up */
#finale p, #finale .finalePhoto { opacity: 0; transform: translateY(6px); }
#finale.show p, #finale.show .finalePhoto {
  opacity: 1; transform: none;
  transition: opacity .6s ease, transform .6s ease;
  transition-delay: calc(.35s + var(--i, 0) * .32s);
}

.finaleBottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.finaleLeft { flex: 1 1 auto; min-width: 0; padding-bottom: 24px; }

/* signature: "Signing Off," small and plain, the name on ONE line in the
   display face, never wrapped */
#finale .sign { margin: 0 0 18px; white-space: nowrap; }
#finale .sign span { display: block; }
#finale .sign .soff { font-family: var(--font-body); font-size: 15px; line-height: 1.4; opacity: .78; }
#finale .sign .name { font-family: var(--font-major); font-size: 24px; line-height: 1.2; }

/* her, no backdrop: the sprite strip, one frame at a time (finale.js sets the
   position). Bottom edge flush with the card's, so she reads as standing in it. */
.finalePhoto {
  flex: none; width: 180px; height: 136px; margin-right: -6px;
  background-repeat: no-repeat; background-size: 400% 100%;
  image-rendering: pixelated; cursor: pointer; user-select: none;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
}

.finaleBtns { display: flex; flex-wrap: wrap; gap: 10px; }
#finale button {
  font: inherit; font-family: var(--font-major); font-size: 13px; color: var(--ink);
  border: none; border-radius: 999px; padding: 9px 18px; cursor: pointer;
  background: linear-gradient(170deg, rgba(255,255,255,.22), rgba(255,255,255,.09));
  box-shadow: 0 1px 3px rgba(0,0,0,.16), inset 0 1px 1px rgba(255,255,255,.40), inset 0 0 0 1px rgba(255,255,255,.16);
}
#finale button:hover { background: linear-gradient(170deg, rgba(255,255,255,.32), rgba(255,255,255,.15)); }
#finale button.quiet { opacity: .7; }

@media (max-width: 520px) {
  #finale { padding: 24px 22px 0; }
  #finale .lead { font-size: 20px; }
  #finale p { font-size: 15px; }
  #finale .quote { font-size: 17px; padding-right: 30px; }
  #finale .sign .name { font-size: 21px; }
  .finalePhoto { width: 126px; height: 95px; margin-right: -4px; }
}
@media (prefers-reduced-motion: reduce) {
  #finale { transition: opacity .2s ease, visibility .2s !important; transform: translate(-50%, -50%) !important; }
  #finale p, #finale .finalePhoto { transition: opacity .2s ease !important; transition-delay: 0s !important; transform: none !important; }
}
