/* ── Feature welcome (feature.js) ───────────────
   A sunrise room in the book's own colours (navy, cream, gold), warm dust drifting up, then two scenes
   on a loop: the welcome, then the book turning in 3D beside its chapter tracker. Opacity and transform only. */
.ft { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; overflow: hidden; pointer-events: none; visibility: hidden; opacity: 0; transition: opacity 1.4s ease, visibility 0s linear 1.4s; background: #08101F; font-family: var(--body, 'Public Sans', sans-serif); }
.ft.on { visibility: visible; opacity: 1; transition: opacity 1.4s ease; }
.ft.on.out { opacity: 0; }
.ft-sky, .ft-sun, .ft-hills, .ft-dust { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.ft-sky { background: linear-gradient(180deg, #060C1A 0%, #0D1A36 38%, #1F2E55 62%, #6B5240 84%, #C98A4B 100%); }
.ft-sun { background: radial-gradient(55% 48% at 50% 86%, rgba(255, 222, 156, 0.95), rgba(244, 176, 88, 0.5) 32%, rgba(214, 130, 60, 0.16) 62%, rgba(214, 130, 60, 0) 82%); transform: translateY(30%); opacity: 0; }
.ft.on .ft-sun { animation: ft-sunrise 5s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both, ft-breathe 7s ease-in-out 5.3s infinite; }
@keyframes ft-sunrise { from { opacity: 0; transform: translateY(30%); } to { opacity: 1; transform: translateY(6%); } }
@keyframes ft-breathe { 0%, 100% { opacity: 1; transform: translateY(6%) scale(1); } 50% { opacity: 0.82; transform: translateY(6%) scale(1.05); } }
.ft-hills { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 1080' preserveAspectRatio='none'%3E%3Cpath d='M0 900 C 240 820 420 860 640 830 C 860 800 1020 870 1240 840 C 1460 810 1680 850 1920 820 L1920 1080 L0 1080Z' fill='%23142242' fill-opacity='0.75'/%3E%3Cpath d='M0 980 C 300 920 560 960 820 935 C 1080 910 1360 965 1600 940 C 1740 925 1840 935 1920 930 L1920 1080 L0 1080Z' fill='%230A1428'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat; }

.ft-scene { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; }
.show-a .ft-a { opacity: 1; animation: ft-scene-out 1s ease-in 9.5s forwards; }
.show-b .ft-b { opacity: 1; animation: ft-scene-out 1s ease-in 18.4s forwards; }
@keyframes ft-scene-out { to { opacity: 0; transform: translateY(-2rem) scale(1.02); } }

/* Scene A: the welcome */
.ft-a { text-align: center; }
.ft-kicker, .ft-bk { display: inline-flex; align-items: center; font-weight: 600; font-size: 2.2rem; letter-spacing: 0.32em; text-transform: uppercase; color: #F3DDB0; white-space: nowrap; opacity: 0; }
.ft-kicker { margin-top: 13rem; }
.ft-bk { letter-spacing: 0.22em; }
.ft-kicker i, .ft-bk i { width: 1.1rem; height: 1.1rem; border-radius: 50%; margin-right: 1.2rem; background: #F2C46D; box-shadow: 0 0 1.4rem #F2C46D, 0 0 3rem rgba(242, 196, 109, 0.6); }
.ft-welcome { margin-top: 2.4rem; font-family: 'Cinzel', Georgia, serif; font-weight: 600; line-height: 1; color: #FFF6E4; }
.ft-w { display: block; font-size: 7.4rem; letter-spacing: 0.06em; opacity: 0; }
.ft-name { display: block; margin-top: 0.6rem; font-size: 17rem; font-weight: 700; letter-spacing: 0.04em; color: #F2C46D; perspective: 1200px; }
.ft-name span { display: inline-block; opacity: 0; text-shadow: 0 0 3rem rgba(242, 196, 109, 0.75), 0 0 9rem rgba(242, 160, 70, 0.45); }
.ft-rule { width: 46rem; height: 0.22rem; margin: 2.6rem auto 0; background: linear-gradient(90deg, rgba(242, 196, 109, 0), #F2C46D 20%, #FFF1D2 50%, #F2C46D 80%, rgba(242, 196, 109, 0)); transform: scaleX(0); }
.ft-line { margin-top: 2.6rem; font-size: 3.6rem; font-weight: 500; color: rgba(255, 244, 222, 0.92); opacity: 0; }
.show-a .ft-kicker { animation: ft-down 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both; }
.show-a .ft-w { animation: ft-spread 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.8s both; }
.show-a .ft-name span { animation-name: ft-letter; animation-duration: 1.2s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); animation-fill-mode: both; }
.show-a .ft-rule { animation: ft-draw 1.6s cubic-bezier(0.65, 0, 0.35, 1) 2.2s both; }
.show-a .ft-line { animation: ft-up 1s cubic-bezier(0.22, 1, 0.36, 1) 2.9s both; }
@keyframes ft-down { from { opacity: 0; transform: translateY(-2.5rem); } to { opacity: 1; transform: none; } }
@keyframes ft-up { from { opacity: 0; transform: translateY(2.5rem); } to { opacity: 1; transform: none; } }
@keyframes ft-spread { from { opacity: 0; transform: translateY(2rem) scale(0.94); letter-spacing: 0.4em; } to { opacity: 1; transform: none; letter-spacing: 0.06em; } }
@keyframes ft-letter { 0% { opacity: 0; transform: translateY(5rem) rotateX(-80deg) scale(1.35); } 55% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes ft-draw { to { transform: scaleX(1); } }

/* Scene B: the book */
.ft-stage { position: absolute; left: 21rem; top: 8rem; width: 34rem; height: 51rem; perspective: 2400px; }
.ft-book { position: relative; width: 34rem; height: 51rem; transform-style: preserve-3d; opacity: 0; }
.ft-cover { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border-radius: 0.2rem 0.5rem 0.5rem 0.2rem; box-shadow: 0 3rem 6rem rgba(0, 0, 0, 0.6), 0 0 9rem rgba(242, 196, 109, 0.28); }
.ft-cover img { display: block; width: 100%; height: 100%; }
.ft-cover::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 1.6rem; background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(255, 255, 255, 0.12) 40%, rgba(0, 0, 0, 0)); }
.ft-pages { position: absolute; top: 0; left: -3.4rem; width: 3.4rem; height: 100%; transform-origin: right center; transform: rotateY(-90deg); background: linear-gradient(90deg, #14213F, #22355E 50%, #14213F); }
.ft-sheen { position: absolute; top: -10%; left: 0; width: 60%; height: 120%; background: linear-gradient(105deg, rgba(255, 240, 210, 0) 20%, rgba(255, 240, 210, 0.5) 50%, rgba(255, 240, 210, 0) 80%); transform: translateX(-130%); }
.ft-shadow { position: absolute; left: -4rem; right: -4rem; bottom: -4.5rem; height: 5rem; background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0)); opacity: 0; }
.show-b .ft-book { animation: ft-book-in 2.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both, ft-book-drift 15.6s ease-in-out 2.8s forwards; }
.show-b .ft-sheen { animation: ft-sheen 1.9s ease-in-out 2.4s both, ft-sheen2 1.9s ease-in-out 11s forwards; }
.show-b .ft-shadow { animation: ft-fade 1.6s ease 1.2s both; }
@keyframes ft-book-in { from { opacity: 0; transform: translate3d(-14rem, 8rem, -50rem) rotateY(80deg) rotateZ(-5deg); } 30% { opacity: 1; } to { opacity: 1; transform: translate3d(0, 0, 0) rotateY(20deg) rotateZ(0); } }
@keyframes ft-book-drift { from { opacity: 1; transform: translate3d(0, 0, 0) rotateY(20deg); } to { opacity: 1; transform: translate3d(0, -1rem, 0) rotateY(9deg); } }
@keyframes ft-sheen { from { transform: translateX(-130%); } to { transform: translateX(230%); } }
@keyframes ft-sheen2 { from { transform: translateX(-130%); } to { transform: translateX(230%); } }
@keyframes ft-fade { from { opacity: 0; } to { opacity: 1; } }

.ft-info { position: absolute; left: 66rem; right: 6rem; top: 50%; transform: translateY(-50%); }
.ft-title { margin-top: 2.2rem; font-family: 'Cinzel', Georgia, serif; font-weight: 600; line-height: 1.04; color: #FFF6E4; }
.ft-title span { display: block; opacity: 0; }
.ft-title .t1 { font-size: 3.4rem; letter-spacing: 0.08em; color: #F3DDB0; }
.ft-title .t2 { font-size: 4.9rem; margin-top: 0.4rem; }
.ft-title .t3 { font-size: 7.2rem; font-weight: 700; color: #F2C46D; text-shadow: 0 0 3rem rgba(242, 196, 109, 0.5); }
.ft-author { margin-top: 1.6rem; font-size: 2.6rem; font-weight: 500; letter-spacing: 0.04em; color: rgba(255, 244, 222, 0.85); opacity: 0; }
.show-b .ft-bk { animation: ft-down 0.9s cubic-bezier(0.22, 1, 0.36, 1) 1.5s both; }
.show-b .ft-title .t1 { animation: ft-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) 1.9s both; }
.show-b .ft-title .t2 { animation: ft-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) 2.15s both; }
.show-b .ft-title .t3 { animation: ft-slam 1.2s cubic-bezier(0.16, 1, 0.3, 1) 2.4s both; }
.show-b .ft-author { animation: ft-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) 2.9s both; }
@keyframes ft-slam { 0% { opacity: 0; transform: scale(1.4); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }

/* Chapter tracker: what's recorded lights up, today's chapters pulse */
.ft-chapters { margin-top: 3.4rem; }
.ft-pips { white-space: nowrap; font-size: 0; }
.ft-pips i { display: inline-block; position: relative; width: 1.8rem; height: 1.8rem; margin-right: 0.28rem; border-radius: 0.35rem; opacity: 0; }
.ft-pips i b { position: absolute; top: 0; left: 0; width: 100%; line-height: 1.8rem; text-align: center; font-size: 0.85rem; font-weight: 700; font-style: normal; }
.ft-pips .ft-done { background: #F2C46D; box-shadow: 0 0 1rem rgba(242, 196, 109, 0.55); }
.ft-pips .ft-done b { color: #1A2340; }
.ft-pips .ft-todo { border: 0.16rem solid #F2C46D; }
.ft-pips .ft-todo b { color: #F3DDB0; }
.show-b .ft-pips .ft-done { animation-name: ft-pop; animation-duration: 0.6s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); animation-fill-mode: both; }
.show-b .ft-pips .ft-todo { animation-name: ft-pop-pulse; animation-duration: 2.2s; animation-timing-function: ease-in-out; animation-iteration-count: infinite; animation-fill-mode: forwards; }
@keyframes ft-pop { from { opacity: 0; transform: scale(0.2); } to { opacity: 1; transform: none; } }
@keyframes ft-pop-pulse { 0% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.08); box-shadow: 0 0 1.2rem rgba(242, 196, 109, 0.7); } 100% { opacity: 0.35; transform: scale(0.85); } }
.ft-ch-label { margin-top: 1.3rem; font-size: 2rem; color: rgba(255, 244, 222, 0.75); opacity: 0; }
.ft-ch-label b { margin-left: 1.6rem; color: #F2C46D; font-weight: 600; }
.show-b .ft-ch-label { animation: ft-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) 5.2s both; }

/* A little level meter: the mic is waiting for him */
.ft-live { margin-top: 3rem; display: flex; align-items: center; opacity: 0; }
.ft-live span { margin-left: 1.6rem; font-size: 1.9rem; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: #F3DDB0; }
.ft-meter { height: 3.2rem; white-space: nowrap; font-size: 0; }
.ft-meter i { display: inline-block; width: 0.45rem; height: 3.2rem; margin-right: 0.3rem; border-radius: 0.3rem; background: #F2C46D; transform-origin: center bottom; transform: scaleY(0.2); }
.show-b .ft-live { animation: ft-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) 5.8s both; }
.show-b .ft-meter i { animation-name: ft-level; animation-timing-function: ease-in-out; animation-iteration-count: infinite; animation-direction: alternate; }
@keyframes ft-level { from { transform: scaleY(0.15); opacity: 0.55; } to { transform: scaleY(1); opacity: 1; } }
