/* Capital Casebook flashing-word layer (文字動態 40 招). Motion stops under prefers-reduced-motion or body.fx-off. */
.fx-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* #34 Glitch Slices */
.gl{position:relative}
.gl-base{display:block}
.gl-layer{position:absolute;inset:0;display:block;pointer-events:none;opacity:0;will-change:transform}
.gl-on .gl-base{color:transparent}
.gl-on .gl-layer{opacity:1;text-shadow:-2px 0 #ff4d6d,2px 0 #36e2ff}
.gl-on .gl-layer:nth-child(even){text-shadow:2px 0 #ff4d6d,-2px 0 #36e2ff}

/* #02 Letter Sequence */
.sl-word{display:inline-block;white-space:nowrap}
.sl-ch{display:inline-block;animation:fx-slam .5s cubic-bezier(.2,1.5,.4,1) both}
@keyframes fx-slam{0%{opacity:0;transform:translateY(-.7em) scale(1.7) rotate(-6deg)}60%{opacity:1}100%{opacity:1;transform:none}}

/* #38 Highlight Text */
.hl{display:inline;background:linear-gradient(transparent 60%,rgba(229,188,123,.7) 60%) no-repeat 0 100%/0 100%;-webkit-box-decoration-break:clone;box-decoration-break:clone;transition:background-size .8s cubic-bezier(.3,.7,.2,1) .15s}
.hl.in{background-size:100% 100%}
.approach .hl{background-image:linear-gradient(transparent 60%,rgba(229,188,123,.35) 60%)}

/* scroll reveal + tilt cards */
.fx-card{--fx-rx:0deg;--fx-ry:0deg}
.fx-rise{opacity:0;transform:translateY(22px);transition:opacity .6s ease calc(var(--i,0)*90ms),transform .6s cubic-bezier(.2,.8,.2,1) calc(var(--i,0)*90ms)}
.fx-rise.in{opacity:1;transform:perspective(800px) rotateX(var(--fx-rx)) rotateY(var(--fx-ry));transition:transform .15s ease-out,opacity .6s,border-color .2s,box-shadow .2s}
.fx-rise.in:hover{transform:perspective(800px) rotateX(var(--fx-rx)) rotateY(var(--fx-ry)) translateY(-4px);box-shadow:0 14px 30px rgba(25,62,54,.16)}
.fx-card:hover h3{animation:fx-gtext .35s steps(2,end) 1}
@keyframes fx-gtext{0%{text-shadow:-2px 0 #ff4d6d,2px 0 #36e2ff}50%{text-shadow:2px 0 #ff4d6d,-2px 0 #36e2ff}100%{text-shadow:none}}

/* #40 Text Echo on brand and library bar */
.brand:hover,.capital-library-nav a:hover{text-shadow:2px 2px 0 rgba(147,101,43,.45),4px 4px 0 rgba(147,101,43,.25),6px 6px 0 rgba(147,101,43,.1)}
.capital-library-nav a:hover{text-shadow:2px 2px 0 rgba(245,206,144,.5),4px 4px 0 rgba(245,206,144,.25),6px 6px 0 rgba(245,206,144,.1)}

/* #03 Text Stamp on feedback boxes */
.fx-stamp{animation:fx-stamp .5s cubic-bezier(.2,1.6,.35,1) both}
@keyframes fx-stamp{0%{opacity:0;transform:scale(1.35) rotate(-2deg)}70%{opacity:1;transform:scale(.98)}100%{opacity:1;transform:none}}

/* #27 Typewriter */
.typing::after{content:'\258D';margin-left:2px;animation:fx-blink .6s steps(1) infinite}
@keyframes fx-blink{50%{opacity:0}}

/* #29 Odometer */
.odo{display:inline-flex;height:1.1em;overflow:hidden;line-height:1.1;vertical-align:bottom}
.odo-col{display:inline-block;height:1.1em;overflow:hidden}
.odo-strip{display:flex;flex-direction:column;transition:transform 1.3s cubic-bezier(.2,.8,.2,1)}
.odo-strip i{font-style:normal;height:1.1em;display:block}

/* #01 Word Burst */
.fx-burst{position:fixed;z-index:9999;transform:translate(-50%,-50%);pointer-events:none;font:700 clamp(24px,5vw,40px)/1 Georgia,'Songti TC',serif;color:#193e36;background:#e5bc7b;padding:8px 18px;border-radius:8px;animation:fx-pop 1s ease-out forwards;box-shadow:0 8px 24px rgba(0,0,0,.2)}
.fx-burst i{position:absolute;left:50%;top:50%;width:8px;height:8px;background:#93652b;border-radius:2px;animation:fx-dot .9s ease-out forwards}
@keyframes fx-pop{0%{opacity:0;transform:translate(-50%,-50%) scale(.2)}20%{opacity:1;transform:translate(-50%,-50%) scale(1.35)}35%{transform:translate(-50%,-50%) scale(1)}80%{opacity:1}100%{opacity:0;transform:translate(-50%,-90%) scale(1)}}
@keyframes fx-dot{from{transform:translate(0,0);opacity:1}to{transform:translate(var(--x),var(--y)) rotate(200deg);opacity:0}}

/* #25 Split Flap (homepage hero) */
.fx-flap-host{margin:-6px 0 22px}
.fx-flap{display:inline-flex;flex-direction:column;gap:8px;text-decoration:none;color:inherit}
.fx-flap-cap{font:700 11px/1.4 system-ui,sans-serif;letter-spacing:2px;text-transform:uppercase;color:var(--gold,#93652b)}
.fx-flap-cells{display:flex;gap:4px;perspective:600px}
.fx-flap-cell{display:inline-block;min-width:1.05em;height:1.55em;padding:0 .12em;text-align:center;font:700 clamp(18px,2.6vw,30px)/1.55 'SF Mono',Menlo,Consolas,'PingFang HK','Noto Sans TC',monospace;color:#f5ce90;background:linear-gradient(#143a31 49%,#000 49%,#000 51%,#1d4a3f 51%);border-radius:5px;box-shadow:0 2px 6px rgba(0,0,0,.3)}
.fx-flap-cell[hidden]{display:none}
.fx-flap-cell.flip{animation:fx-flip .12s ease-out}
.fx-flap:hover .fx-flap-cell,.fx-flap:focus-visible .fx-flap-cell{box-shadow:0 0 0 1px #e5bc7b,0 2px 10px rgba(229,188,123,.4)}
@keyframes fx-flip{0%{transform:rotateX(-75deg);filter:brightness(1.8)}100%{transform:none;filter:none}}

/* #14 Marquee (homepage) */
.fx-marquee{margin:0 calc(50% - 50vw) 10px;padding:12px 0;overflow:hidden;border-block:1px solid #cfd4c8;background:#fffdf7;user-select:none;width:100vw;max-width:100vw}
.fx-mq-row{overflow:hidden}
.fx-mq-track{display:flex;width:max-content;animation:fx-mq 55s linear infinite}
.fx-mq-row.b .fx-mq-track{animation-direction:reverse;animation-duration:65s}
.fx-marquee:hover .fx-mq-track{animation-play-state:paused}
.fx-mq-track>span{display:flex;align-items:center;flex:none}
.fx-mq-track a{text-decoration:none;font:500 clamp(30px,4.8vw,64px)/1.3 Georgia,'Songti TC',serif;letter-spacing:-.02em;padding:0 .35em;color:#193e36;transition:color .2s}
.fx-mq-row.b a{color:rgba(25,62,54,.34);font-size:clamp(24px,3.6vw,46px)}
.fx-mq-track a:hover{color:#93652b;text-shadow:3px 0 #ff4d6d,-3px 0 #36e2ff}
.fx-mq-track .dot{color:#e5bc7b;font-size:.9rem}
@keyframes fx-mq{to{transform:translateX(-50%)}}

/* homepage stats (odometer) */
.fx-stats{display:flex;justify-content:center;gap:clamp(24px,7vw,96px);flex-wrap:wrap;padding:34px 0 8px;text-align:center}
.fx-stats>div{display:flex;flex-direction:column;align-items:center;gap:2px}
.fx-stats b{font:500 clamp(40px,6vw,72px)/1.1 Georgia,serif;letter-spacing:-.03em;color:#193e36}
.fx-stats>div>span{font-size:12px;font-weight:700;letter-spacing:2px;text-transform:uppercase;color:var(--gold,#93652b)}

/* reading progress + effects toggle */
#fx-progress{position:fixed;left:0;top:0;height:3px;width:100%;background:linear-gradient(90deg,#e5bc7b,#93652b);transform:scaleX(0);transform-origin:0 50%;z-index:9990;pointer-events:none}
#fx-toggle{position:fixed;right:14px;bottom:14px;z-index:9980;background:#193e36;color:#fff9eb;border:1px solid #193e36;font:600 13px/1.4 system-ui,sans-serif;padding:7px 14px;border-radius:999px;box-shadow:0 4px 14px rgba(0,0,0,.2);cursor:pointer}
#fx-toggle:hover{background:#2b5a4e}
#fx-toggle[aria-pressed=false]{background:#f6f3eb;color:#193e36;border-color:#89998e}
#fx-toggle:focus-visible{outline:3px solid #b57b30;outline-offset:4px}

.fx-off *,.fx-off *::before,.fx-off *::after{animation:none!important}
.fx-off .fx-rise{opacity:1;transform:none;transition:none}
.fx-off .hl{background-size:100% 100%}
.fx-off .fx-mq-track{animation:none}
@media(max-width:600px){#fx-toggle{right:10px;bottom:10px}.fx-flap-cell{font-size:18px}}
@media(prefers-reduced-motion:reduce){.fx-mq-track,.fx-flap-cell,.sl-ch,.fx-burst,.fx-stamp,.fx-card h3{animation:none!important}.fx-rise{opacity:1;transform:none;transition:none}.hl{background-size:100% 100%;transition:none}.odo-strip{transition:none}}
@media print{.fx-marquee,.fx-flap-host,#fx-toggle,#fx-progress{display:none!important}.fx-rise{opacity:1!important;transform:none!important}}
