/* ============================================================
 *  09-finale-letter.css — Variant A: Velvet Room Birthday Card
 *  (single 3D card flip, tap to open)
 * ============================================================ */

/* ---------- Backdrop ---------- */
.finale--letter .vcard-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 0%, transparent 38%, rgba(2, 6, 18, 0.75) 78%, rgba(2, 6, 18, 0.95) 100%);
}

.finale--letter .vcard-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(920px, 90vmax);
  height: min(920px, 90vmax);
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(circle,
    rgba(255, 224, 144, 0.28) 0%,
    rgba(201, 164, 97, 0.14) 22%,
    transparent 58%);
  border-radius: 50%;
}

/* ---------- Stage ---------- */
.finale--letter .vcard-stage {
  position: relative;
  width: min(92vw, 440px);
  aspect-ratio: 3 / 4;
  perspective: 1600px;
  perspective-origin: 50% 50%;
  z-index: 2;
}

.finale--letter .vcard-shadow {
  position: absolute;
  left: 50%;
  bottom: -26px;
  width: 72%;
  height: 32px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.6) 0%, transparent 70%);
  pointer-events: none;
}

/* ---------- Flipper (3D pivot) ---------- */
.finale--letter .vcard-flipper {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  cursor: pointer;
  outline: none;
  pointer-events: auto;
  /* Transform is fully driven by GSAP (intro + idle + flip). CSS transition
   * is intentionally absent so GSAP owns the property cleanly. */
}
.finale--letter .vcard-flipper:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 216, 122, 0.6);
}

/* ---------- Shared face styles ---------- */
.finale--letter .vcard-face {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  box-shadow:
    0 0 0 1px rgba(107, 74, 18, 0.35),
    0 30px 64px rgba(0, 0, 0, 0.7),
    inset 0 0 0 4px rgba(201, 164, 97, 0.22);
  overflow: hidden;
}

.finale--letter .vcard-corner {
  position: absolute;
  width: 60px;
  height: 60px;
  pointer-events: none;
}
.finale--letter .vcard-corner.tl { top: 10px; left: 10px; }
.finale--letter .vcard-corner.tr { top: 10px; right: 10px; }
.finale--letter .vcard-corner.bl { bottom: 10px; left: 10px; }
.finale--letter .vcard-corner.br { bottom: 10px; right: 10px; }

/* ---------- Cover face (shown first) ---------- */
.finale--letter .vcard-face--cover {
  background:
    /* subtle gold damask dots */
    radial-gradient(circle at 50% 18%, rgba(255, 216, 122, 0.18), transparent 24%),
    radial-gradient(circle at 18% 72%, rgba(255, 216, 122, 0.08), transparent 20%),
    radial-gradient(circle at 82% 72%, rgba(255, 216, 122, 0.08), transparent 20%),
    linear-gradient(160deg, #152c78 0%, #0a1850 50%, #050d30 100%);
  border: 1px solid #c9a461;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  place-items: center;
  padding: 48px 28px 36px;
  text-align: center;
  isolation: isolate;
}

.finale--letter .vcard-face--cover .vcard-corner {
  display: none;
}

.finale--letter .vcard-cover-art {
  position: absolute;
  inset: 10px;
  border-radius: 4px;
  overflow: hidden;
  z-index: 0;
  box-shadow:
    0 0 0 1px rgba(255, 216, 122, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.finale--letter .vcard-cover-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.finale--letter .vcard-cover-art::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(1, 5, 24, 0.62) 0%,
      rgba(1, 5, 24, 0.14) 22%,
      rgba(1, 5, 24, 0.05) 62%,
      rgba(1, 5, 24, 0.68) 100%),
    radial-gradient(circle at 50% 18%, rgba(255, 216, 122, 0.18), transparent 26%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 216, 122, 0.34),
    inset 0 0 44px rgba(0, 0, 0, 0.42);
}

.finale--letter .vcard-cover-ribbon {
  position: relative;
  z-index: 2;
  align-self: start;
  font-family: var(--font-p5-mono);
  font-size: 0.72rem;
  letter-spacing: 7px;
  color: #ffd87a;
  text-shadow: 0 0 12px rgba(255, 216, 122, 0.65);
  max-width: 92%;
  padding: 8px 18px;
  background: rgba(3, 10, 39, 0.58);
  border-top: 1px solid rgba(255, 216, 122, 0.45);
  border-bottom: 1px solid rgba(255, 216, 122, 0.45);
}

.finale--letter .vcard-cover-spacer {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100%;
  pointer-events: none;
}

.finale--letter .vcard-cover-house {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 9px;
  color: #ffd87a;
  text-shadow: 0 0 10px rgba(255, 216, 122, 0.5);
  padding: 4px 12px;
  background: rgba(3, 10, 39, 0.46);
}
.finale--letter .vcard-cover-tag {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 8px;
  color: #c9a461;
  opacity: 0.8;
}

/* ---------- Inside face (revealed) ---------- */
.finale--letter .vcard-face--inside {
  transform: rotateY(180deg);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 242, 196, 0.38) 0%, transparent 44%),
    linear-gradient(180deg, #fbf3dc 0%, #f5e7be 50%, #efd9a1 100%);
  border: 1px solid #b48c44;
  padding: 42px 32px 28px;
  color: #2b1a06;
  text-align: center;
}

.finale--letter .vcard-inside-body {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.finale--letter .vcard-arcana-label {
  font-family: var(--font-p5-mono);
  font-size: 0.62rem;
  letter-spacing: 5px;
  color: #8a6420;
}
.finale--letter .vcard-dot { margin: 0 5px; color: #c9a461; }

.finale--letter .vcard-sun {
  font-size: clamp(3rem, 10vw, 4.2rem);
  line-height: 1;
  color: #b87c1a;
  text-shadow:
    0 0 18px rgba(255, 216, 122, 0.7),
    0 1px 0 rgba(255, 255, 255, 0.4);
  margin: 2px 0;
}

.finale--letter .vcard-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  letter-spacing: 6px;
  line-height: 1;
  background: linear-gradient(180deg, #faecb0 0%, #d4a24a 48%, #8a5e1a 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(90, 59, 12, 0.45));
}

.finale--letter .vcard-divider {
  margin: 4px auto 2px;
  width: min(100%, 320px);
}
.finale--letter .vcard-divider svg {
  width: 100%;
  height: 16px;
  display: block;
}

.finale--letter .vcard-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4vw, 1.75rem);
  letter-spacing: 7px;
  line-height: 1;
  text-transform: uppercase;
  background: linear-gradient(180deg, #caa34b 0%, #7a510e 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.finale--letter .vcard-dedication {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #3a2a0a;
  max-width: 34ch;
  margin: 4px auto 0;
}

.finale--letter .vcard-signature {
  margin-top: 10px;
  font-family: 'Cormorant Garamond', var(--font-body);
  font-style: italic;
  font-size: 1.08rem;
  letter-spacing: 1.2px;
  color: #7a5510;
}

.finale--letter .vcard-footer-stars {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 10px;
  color: #9a7730;
  opacity: 0.85;
}

/* ---------- Tap prompt ---------- */
.finale--letter .vcard-tap-prompt {
  position: absolute;
  top: calc(100% + 76px);
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-p5-mono);
  font-size: 0.78rem;
  letter-spacing: 7px;
  color: #ffd87a;
  text-shadow: 0 0 12px rgba(255, 216, 122, 0.65);
  z-index: 4;
  pointer-events: none;
  white-space: nowrap;
}
.finale--letter .vcard-chevron {
  display: inline-block;
  font-size: 0.9rem;
  color: #ffd87a;
  animation: vcardChevron 1.35s ease-in-out infinite;
  transform: rotate(180deg);
}
.finale--letter .vcard-chevron:last-child { animation-delay: 0.18s; }
.finale--letter .vcard-prompt-text { font-weight: 700; }
@keyframes vcardChevron {
  0%, 100% { transform: translateY(0) rotate(180deg);    opacity: 0.55; }
  50%      { transform: translateY(6px) rotate(180deg);  opacity: 1; }
}

.finale--letter .vcard-under-caption {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  width: min(92vw, 460px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  color: #ffd87a;
  text-shadow:
    0 0 14px rgba(255, 216, 122, 0.65),
    0 2px 14px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 4;
}
.finale--letter .vcard-under-caption span {
  font-family: var(--font-p5-mono);
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 5px;
}
.finale--letter .vcard-under-caption b {
  font-family: var(--font-display);
  font-size: 0.92rem;
  line-height: 1;
  letter-spacing: 4px;
  font-weight: 700;
}

/* ---------- Japanese adjustments ---------- */
html[lang='ja'] .finale--letter .vcard-tagline {
  font-family: var(--font-body);
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}
html[lang='ja'] .finale--letter .vcard-name {
  letter-spacing: 0.12em;
  font-size: clamp(2rem, 7vw, 2.8rem);
}
html[lang='ja'] .finale--letter .vcard-dedication,
html[lang='ja'] .finale--letter .vcard-signature,
html[lang='ja'] .finale--letter .vcard-cover-house,
html[lang='ja'] .finale--letter .vcard-cover-ribbon,
html[lang='ja'] .finale--letter .vcard-prompt-text,
html[lang='ja'] .finale--letter .vcard-under-caption span,
html[lang='ja'] .finale--letter .vcard-under-caption b {
  letter-spacing: 0.06em;
}
html[lang='ja'] .finale--letter .vcard-arcana-label {
  letter-spacing: 3px;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .finale--letter .vcard-stage {
    width: 84vw;
  }
  .finale--letter .vcard-face--cover { padding: 34px 18px 26px; }
  .finale--letter .vcard-face--inside { padding: 30px 20px 22px; }
  .finale--letter .vcard-cover-ribbon { font-size: 0.62rem; letter-spacing: 4px; padding: 6px 10px; }
  .finale--letter .vcard-cover-house  { font-size: 0.9rem; letter-spacing: 5px; }
  .finale--letter .vcard-cover-tag    { font-size: 0.65rem; letter-spacing: 5px; }
  .finale--letter .vcard-cover-art    { inset: 7px; }
  .finale--letter .vcard-corner       { width: 42px; height: 42px; }
  .finale--letter .vcard-tap-prompt   { font-size: 0.64rem; letter-spacing: 4px; top: calc(100% + 62px); bottom: auto; }
  .finale--letter .vcard-under-caption { top: calc(100% + 12px); gap: 4px; }
  .finale--letter .vcard-under-caption span { font-size: 0.58rem; letter-spacing: 3px; }
  .finale--letter .vcard-under-caption b { font-size: 0.72rem; letter-spacing: 2px; }
  .finale--letter .vcard-tagline      { letter-spacing: 5px; }
  .finale--letter .vcard-name         { letter-spacing: 3px; }
}
