/* ===== 主頁 風格 B「星夜」=====
 * 深藍底、金色線條；封面一個月牙，之後一章一個全螢幕畫面（上下切換，仿 nyakei.com：頁碼 01 / 03、箭頭、右側進度線）
 */
html, body { height: 100%; overflow: hidden; }
.home-b { background: var(--bg); }

/* 星空背景（固定不動，微微閃爍） */
.b-sky { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(40,70,140,.45), transparent 70%),
    radial-gradient(1.4px 1.4px at 12% 22%, #fff9 50%, transparent 52%), radial-gradient(1px 1px at 28% 68%, #fff8 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 44% 14%, #fffb 50%, transparent 52%), radial-gradient(1px 1px at 63% 40%, #fff8 50%, transparent 52%),
    radial-gradient(1.3px 1.3px at 78% 80%, #fff9 50%, transparent 52%), radial-gradient(1px 1px at 88% 18%, #fffa 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 6% 84%, #fff7 50%, transparent 52%), radial-gradient(1px 1px at 52% 90%, #fff6 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 94% 56%, #fff9 50%, transparent 52%), radial-gradient(1px 1px at 36% 38%, #fff6 50%, transparent 52%);
  animation: b-twinkle 6s ease-in-out infinite alternate;
}
@keyframes b-twinkle { from { opacity: .65; } to { opacity: 1; } }

.b-top { position: fixed; inset: 0 0 auto 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 0; pointer-events: none; }
.b-top > * { pointer-events: auto; }
.b-mark { text-decoration: none; font: 400 1.05rem/1 var(--serif); letter-spacing: .14em; }
.b-mark em { font-style: italic; color: var(--accent); }
.who { font-size: .76rem; color: var(--muted); letter-spacing: .1em; white-space: nowrap; }
.who button { border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 999px; padding: 2px 14px; font-size: .76rem; letter-spacing: .12em; }

/* 全螢幕一章一頁 */
.b-scroll { position: relative; z-index: 1; height: 100vh; height: 100svh; overflow-y: auto; scroll-snap-type: y mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.b-scroll::-webkit-scrollbar { display: none; }
.b-screen {
  height: 100vh; height: 100svh; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 70px 24px 90px; gap: 0;
}
.b-art { width: min(400px, 68vw); max-height: 34svh; margin-bottom: 14px; }
.b-art .art { max-height: 34svh; }
.b-moon { width: min(300px, 56vw); }
.b-eyebrow { font: 400 .74rem/1 var(--serif); letter-spacing: .5em; color: var(--muted); margin: 8px 0 16px; }
.b-names { font: 300 clamp(2.3rem, 8vw, 4.4rem)/1.2 'Noto Serif TC', var(--serif); letter-spacing: .16em; }
.b-names span { font: italic 300 .6em var(--serif); color: var(--accent); margin: 0 .5em; letter-spacing: 0; }
.b-date { margin-top: 18px; font: 300 1.2rem/1.2 var(--num); letter-spacing: .26em; color: var(--accent); }
.b-event { margin-top: 8px; color: var(--muted); letter-spacing: .18em; font-size: .9rem; }
.b-verse { margin-top: 22px; max-width: 28em; font: 300 .84rem/1.9 'Noto Serif TC', serif; color: var(--muted); letter-spacing: .08em; }
.b-start, .b-cta {
  margin-top: 26px; display: inline-flex; align-items: center; gap: 14px; text-decoration: none; background: transparent;
  border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: .7em 2.2em .7em 2.4em; letter-spacing: .4em; font-size: .85rem; transition: .3s;
}
.b-start i, .b-cta i { width: 22px; height: 1px; background: currentColor; position: relative; transition: width .3s; }
.b-start i::after, .b-cta i::after { content: ''; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.b-start:hover, .b-cta:hover { background: var(--accent); color: var(--on-accent); }
.b-start:hover i, .b-cta:hover i { width: 34px; }
.b-day { font: 400 .74rem/1 var(--serif); letter-spacing: .45em; color: var(--accent); margin: 6px 0 14px; }
.b-screen h2 { font: 400 clamp(1.9rem, 6vw, 2.8rem)/1.3 'Noto Serif TC', serif; letter-spacing: .34em; margin-right: -.34em; }
.b-quote { margin-top: 10px; font: italic 300 .98rem/1.8 'Noto Serif TC', serif; color: var(--muted); letter-spacing: .08em; }
.b-desc { margin-top: 14px; max-width: 24em; color: var(--ink); opacity: .85; letter-spacing: .06em; font-size: .92rem; }
.b-act { display: flex; flex-direction: column; align-items: center; }
.lock-note { margin-top: 22px; display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; color: var(--muted); font-size: .85rem; letter-spacing: .12em; }
.lock-note small { width: 100%; opacity: .8; }
.b-cta + .lock-note { margin-top: 14px; }
.b-screen.is-locked .b-art { opacity: .6; }

/* 進場動態：目前這一頁的文字依序浮現，線稿畫出 */
.b-screen > :not(.b-art) { opacity: 0; transform: translateY(14px); transition: opacity .9s, transform .9s; }
.b-screen.is-current > :not(.b-art) { opacity: 1; transform: none; }
.b-screen.is-current > *:nth-child(2) { transition-delay: .15s; } .b-screen.is-current > *:nth-child(3) { transition-delay: .3s; }
.b-screen.is-current > *:nth-child(4) { transition-delay: .45s; } .b-screen.is-current > *:nth-child(5) { transition-delay: .6s; }
.b-screen.is-current > *:nth-child(6) { transition-delay: .75s; } .b-screen.is-current > *:nth-child(7) { transition-delay: .9s; }
.b-screen.is-current .b-art .sh { animation: pop 1s cubic-bezier(.22,.7,.2,1) forwards; animation-delay: calc(var(--i, 0) * .12s); }
html:not(.js) .b-screen > :not(.b-art) { opacity: 1; transform: none; }

/* 左下：頁碼 01 / 03 與章名 */
.b-count { position: fixed; left: clamp(16px, 4vw, 40px); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: baseline; gap: 14px; pointer-events: none; }
.b-num { font: 200 1.5rem/1 var(--num); letter-spacing: .1em; color: var(--muted); }
.b-num b { font-weight: 300; color: var(--accent); font-size: 1.9rem; }
.b-label { font-size: .78rem; letter-spacing: .3em; color: var(--muted); }

/* 右側：進度線與圓點 */
.b-rail { position: fixed; right: clamp(12px, 3vw, 30px); top: 50%; transform: translateY(-50%); z-index: 30; display: flex; flex-direction: column; gap: 22px; padding: 4px 0; }
.b-rail-line { position: absolute; left: 50%; top: 8px; bottom: 8px; width: 1px; background: var(--soft); transform: translateX(-50%); }
.b-rail-line i { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(var(--p, 0)); transition: transform .5s; }
.b-dot { position: relative; width: 11px; height: 11px; padding: 0; border-radius: 50%; border: 1px solid var(--soft); background: var(--bg); transition: .4s; }
.b-dot::after { content: ''; position: absolute; inset: -12px; }
.b-dot.is-on { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.b-arrows { position: fixed; right: clamp(12px, 3vw, 30px); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 30; display: none; gap: 8px; }
.b-arrows button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--soft); background: transparent; color: var(--accent); font-size: 1rem; }
.b-arrows button:hover { border-color: var(--accent); }

@media (min-width: 768px) { .b-arrows { display: flex; } }

@media (max-height: 640px) { .b-art, .b-art .art { max-height: 26svh; } .b-desc, .b-verse { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .b-sky { animation: none; } .b-scroll { scroll-behavior: auto; }
  .b-screen > :not(.b-art) { opacity: 1 !important; transform: none !important; transition: none !important; }
}
