body.login {
  background:
    radial-gradient(1200px 700px at 50% 35%, #1a2a5a 0%, transparent 60%),
    radial-gradient(circle at 1px 1px, rgba(201,161,74,.12) 1px, transparent 0) 0 0 / 26px 26px,
    var(--navy-950);
  color: var(--paper);
  overflow-x: hidden;
}

.scene {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px 24px; position: relative;
}
.spotlight {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px 360px at 50% 45%, rgba(236,213,147,.13), transparent 70%);
}

/* ------------------------------------------------------------------ scattered memories */
.memories { position: absolute; inset: 0; pointer-events: none; }
.mem { position: absolute; width: 170px; opacity: .92; animation: drift 9s ease-in-out infinite alternate; }
.mem .polaroid-photo { font-size: 58px; filter: saturate(.85); }
.mem figcaption { font-size: 17px; }
.ph-a { background: linear-gradient(140deg, #2c4a8a, #13214a); }
.ph-b { background: linear-gradient(140deg, #6f8f5a, #2d4b2a); }
.ph-c { background: linear-gradient(140deg, #c58b4b, #6d4220); }
.ph-d { background: linear-gradient(140deg, #8a3a46, #3d1520); }
.ph-e { background: linear-gradient(140deg, #3f7f8f, #183a44); }
.mem--1 { top: 7%;  left: 6%;  --r: -9deg; }
.mem--2 { top: 52%; left: 3%;  --r: 7deg;  animation-delay: -3s; }
.mem--3 { top: 9%;  right: 6%; --r: 8deg;  animation-delay: -5s; }
.mem--4 { top: 55%; right: 4%; --r: -6deg; animation-delay: -1s; }
.mem--5 { top: 31%; left: 18%; --r: 4deg;  width: 130px; animation-delay: -7s; }
.mem { transform: rotate(var(--r)); }
@keyframes drift { to { transform: rotate(calc(var(--r) * -.4)) translateY(-8px); } }

/* ------------------------------------------------------------------ the book */
.book {
  position: relative; width: min(440px, 100%); aspect-ratio: 3 / 4.15;
  perspective: 1800px; perspective-origin: 0 50%;
  z-index: 2;
}
.book-pages {
  position: absolute; inset: 6px -10px 6px 8px; border-radius: 4px 10px 10px 4px;
  background: repeating-linear-gradient(90deg, #efe6cc 0 2px, #d7c9a2 2px 3px);
  box-shadow: 0 30px 60px rgba(0,0,0,.6);
}
.book-inside {
  position: absolute; inset: 6px 0 6px 8px; border-radius: 4px 10px 10px 4px;
  background: linear-gradient(90deg, #e7dcbd, var(--paper) 12%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  color: var(--navy-800);
}
.hand { font-family: var(--font-hand); font-size: 46px; margin: 0; }
.hand--sm { font-size: 20px; color: var(--ink-soft); }

.book-cover {
  position: absolute; inset: 0; border-radius: 6px 14px 14px 6px; transform-origin: left center;
  transition: transform 1.1s cubic-bezier(.6,.05,.25,1);
  background:
    radial-gradient(120% 80% at 30% 10%, rgba(255,255,255,.08), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.015) 0 2px, transparent 2px 5px),
    linear-gradient(160deg, var(--navy-700), var(--navy-900) 70%);
  box-shadow: inset 0 0 0 1px rgba(201,161,74,.35), inset 14px 0 18px -10px rgba(0,0,0,.6), 0 26px 50px rgba(0,0,0,.55);
  padding: 18px; backface-visibility: hidden;
}
.book-spine {
  position: absolute; left: -10px; top: 0; bottom: 0; width: 16px; border-radius: 6px 0 0 6px;
  background: linear-gradient(90deg, #060b1c, var(--navy-800));
  box-shadow: inset -2px 0 4px rgba(0,0,0,.6);
}
.book.is-open .book-cover { transform: rotateY(-168deg); }
.book.is-open .pin-form { pointer-events: none; }

.cover-frame {
  position: relative; height: 100%; border: 1.5px solid rgba(201,161,74,.7); border-radius: 4px;
  outline: 1px solid rgba(201,161,74,.3); outline-offset: -7px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 22px 26px;
}
.corner { position: absolute; width: 22px; height: 22px; border: 2px solid var(--gold); }
.corner--tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.corner--tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.corner--bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.corner--br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

.cover-emblem { filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.cover-kicker { margin: 10px 0 0; font-size: 11px; letter-spacing: .32em; color: var(--gold); }
.cover-title {
  margin: 4px 0 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(38px, 9vw, 52px); line-height: 1.25;
  background: linear-gradient(180deg, #fff3c9 0%, var(--gold-light) 30%, var(--gold) 60%, var(--gold-dark) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 0 rgba(0,0,0,.15);
}
.cover-sub { margin: 2px 0 0; font-family: var(--font-hand); font-size: 21px; color: var(--paper); opacity: .9; }
.ornament { display: flex; align-items: center; gap: 10px; color: var(--gold); margin: 12px 0 14px; width: 70%; }
.ornament span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

.pin-form { width: 100%; max-width: 280px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.pin-form label { font-size: 13px; color: var(--gold-light); opacity: .85; }
.pin-box { position: relative; }
.pin-box input {
  width: 100%; text-align: center; font-size: 24px; letter-spacing: .5em; padding: 10px 40px 10px calc(40px + .5em);
  background: rgba(5,10,25,.45); border: 1px solid rgba(201,161,74,.55); border-radius: 10px; color: var(--gold-light);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.pin-box input::placeholder { color: rgba(236,213,147,.35); letter-spacing: .3em; }
.pin-box input:focus { border-color: var(--gold-light); box-shadow: 0 0 0 4px rgba(201,161,74,.18); }
.pin-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px;
  border: 0; background: none; cursor: pointer; opacity: .6; font-size: 16px; z-index: 1;
}
.pin-eye:hover { opacity: 1; }
.pin-error { min-height: 1.4em; margin: 0; font-size: 13px; color: #ff9d8f; }
.btn--open { min-height: 46px; font-size: 16px; }
.btn--open > span { pointer-events: none; }
.pin-form.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.cover-motto { margin: 18px 0 0; font-size: 12px; letter-spacing: .18em; color: var(--gold); opacity: .8; }
.fineprint { position: relative; z-index: 2; margin: 26px 0 0; font-size: 12px; color: rgba(247,241,225,.5); text-align: center; }

@media (max-width: 1280px) { .mem--5 { display: none; } }
@media (max-width: 900px) {
  .mem--2, .mem--4, .mem--5 { display: none; }
  .mem { width: 120px; opacity: .45; }
  .mem--1 { top: 2%; left: -20px; }
  .mem--3 { top: auto; bottom: 2%; right: -14px; }
}
@media (max-width: 480px) {
  .book { aspect-ratio: auto; min-height: 560px; }
  .cover-frame { padding: 22px 14px; }
  .cover-sub { font-size: 18px; }
}
