/* 回响 Echo — motion layer. 墨 #11100E · 纸 #F1ECE2 · 朱 #FF5A28 */
:root { --x-ease: cubic-bezier(.22, 1, .36, 1); --x-verm: #ff5a28; --x-ink: #11100e; --x-paper: #f1ece2; }

/* 5. scroll progress */
.x-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1000; pointer-events: none; background: var(--x-verm); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }

/* 8. film grain */
.x-grain { position: fixed; inset: -50%; z-index: 999; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: x-grain 1.2s steps(6) infinite; }
@keyframes x-grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); } 40% { transform: translate(3%, -5%); } 60% { transform: translate(-6%, -2%); } 80% { transform: translate(5%, 4%); } 100% { transform: translate(0, 0); } }

/* 7. marquee */
.x-marquee { overflow: hidden; background: var(--x-verm); color: var(--x-ink); border-top: 1px solid var(--x-ink); border-bottom: 1px solid var(--x-ink); padding: 14px 0; position: relative; }
.x-marquee__track { display: flex; width: max-content; white-space: nowrap; will-change: transform; }
.x-marquee__track span { font-family: "Anton", "Impact", sans-serif; font-size: clamp(28px, 4.4vw, 56px); line-height: 1; letter-spacing: .02em; text-transform: uppercase; padding-right: .5em; }

/* 1. cursor */
html.x-cursor-on, html.x-cursor-on * { cursor: none !important; }
html.x-cursor-on input, html.x-cursor-on textarea, html.x-cursor-on select, html.x-cursor-on [contenteditable] { cursor: auto !important; }
.x-cursor, .x-ring { position: fixed; top: 0; left: 0; z-index: 1001; pointer-events: none; mix-blend-mode: difference; will-change: transform; opacity: 0; transition: opacity .3s var(--x-ease); }
html.x-cursor-on.x-cursor-in .x-cursor, html.x-cursor-on.x-cursor-in .x-ring { opacity: 1; }
.x-cursor { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--x-verm); }
.x-ring { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
.x-ring__box { position: absolute; inset: 0; border: 1px solid var(--x-verm); transition: transform .45s var(--x-ease); }
.x-ring__inner { position: absolute; inset: 11px; border: 1px solid var(--x-verm); opacity: 0; transform: scale(.4); transition: opacity .35s var(--x-ease), transform .45s var(--x-ease); }
.x-ring__box { transition: transform .45s var(--x-ease), background-color .3s var(--x-ease); }
.x-ring__label { position: absolute; left: 50%; top: 50%; white-space: nowrap; font: 700 13px/1 "Space Grotesk", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif; letter-spacing: .12em; color: var(--x-ink); opacity: 0; transform: translate(-50%, -50%) scale(.6); transition: opacity .3s var(--x-ease), transform .45s var(--x-ease); }
.x-ring.is-link .x-ring__box { transform: scale(1.6); }
.x-ring.is-link .x-ring__inner { opacity: 1; transform: scale(1.6); }
.x-ring.is-label { mix-blend-mode: normal; }
.x-ring.is-label .x-ring__box { transform: scale(2); background: var(--x-verm); }
.x-ring.is-label .x-ring__label { opacity: 1; transform: translate(-50%, -50%) scale(1); }
html.x-labeled .x-cursor { opacity: 0 !important; }
.x-ring.is-down .x-ring__box { transform: scale(.7); }
.x-ring.is-down.is-link .x-ring__box { transform: scale(1.2); }
.x-ring.is-down.is-label .x-ring__box { transform: scale(1.75); }
.x-echo { position: fixed; top: 0; left: 0; width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 1px solid var(--x-verm); z-index: 1001; pointer-events: none; mix-blend-mode: difference; animation: x-echo .8s var(--x-ease) forwards; }
@keyframes x-echo { from { opacity: 1; scale: .6; } to { opacity: 0; scale: 4; } }

/* 3. tilt */
.x-tilt { display: block; position: relative; transform-style: preserve-3d; will-change: transform; transition: transform .7s var(--x-ease); }
.x-tilt.is-active { transition: transform .12s linear; }
.x-tilt > img { display: block; }
.x-sheen { position: absolute; inset: 0; pointer-events: none; opacity: 0; mix-blend-mode: soft-light;
  background: radial-gradient(circle at var(--sx, 50%) var(--sy, 50%), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 55%);
  transition: opacity .5s var(--x-ease); }
.x-tilt.is-active .x-sheen { opacity: 1; }
/* decorative layers never take clicks */
.x-sheen, .x-tilt::before, .x-tilt::after, .hero-shot::before, .chap-media .ornament, .chap-media .ornament::before, .chap-media .ornament::after, .x-spot::after { pointer-events: none !important; }

/* screenshots open the lightbox */
.x-shot { cursor: zoom-in; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; transition: opacity .3s var(--x-ease); }
.x-shot--out { opacity: 0; }

/* gallery: drag, snap toggle, controls */
#shots .gallery { overscroll-behavior-x: contain; }
#shots .gallery.x-nosnap { scroll-snap-type: none !important; }
#shots .gallery.x-dragging, #shots .gallery.x-dragging * { user-select: none; cursor: grabbing; }
#shots .gallery.x-dragging .x-tilt { transform: none !important; }
.x-gal-ctl { flex: 1 1 100%; order: -1; display: flex; align-items: center; gap: 12px; }
.x-gal-btn { flex: none; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; background: transparent; color: var(--x-paper); border: 1px solid rgba(241, 236, 226, .4); border-radius: 0; cursor: pointer; transition: background-color .3s var(--x-ease), color .3s var(--x-ease), border-color .3s var(--x-ease), opacity .3s var(--x-ease); }
.x-gal-btn:hover:not(:disabled) { background: var(--x-verm); border-color: var(--x-verm); color: var(--x-ink); }
.x-gal-btn:disabled { opacity: .3; cursor: default; }
.x-track { position: relative; flex: 1; height: 44px; cursor: pointer; touch-action: none; }
.x-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(201, 185, 154, .35); pointer-events: none; }
.x-thumb { position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1px; background: var(--x-verm); will-change: transform; transition: height .25s var(--x-ease), margin-top .25s var(--x-ease); }
.x-thumb::after { content: ""; position: absolute; left: 0; right: 0; top: -20px; bottom: -20px; }
.x-track:hover .x-thumb, .x-track.is-scrub .x-thumb { height: 5px; margin-top: -2px; }

/* lightbox */
html.x-lock, html.x-lock body { overflow: hidden !important; }
.x-lb { position: fixed; inset: 0; z-index: 1000; touch-action: none; user-select: none; -webkit-user-select: none; }
.x-lb[hidden] { display: none; }
.x-lb__bg { position: absolute; inset: 0; background: rgba(17, 16, 14, .92); opacity: 0; transition: opacity .5s var(--x-ease); }
.x-lb__img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; will-change: transform; object-fit: contain; background: var(--x-ink); outline: 1px solid rgba(241, 236, 226, .2); -webkit-user-drag: none; cursor: grab; }
.x-lb__cap, .x-lb__btn { opacity: 0; transition: opacity .4s var(--x-ease) .12s, background-color .3s var(--x-ease), color .3s var(--x-ease), border-color .3s var(--x-ease); }
.x-lb.is-open .x-lb__bg, .x-lb.is-open .x-lb__cap, .x-lb.is-open .x-lb__btn { opacity: 1; }
.x-lb__cap { position: absolute; left: 16px; right: 16px; bottom: 28px; display: flex; justify-content: center; align-items: baseline; gap: 16px; margin: 0; color: var(--x-paper); font-size: 15px; line-height: 1.5; text-align: center; pointer-events: none; }
.x-lb__count { flex: none; font: 500 12px/1 "Space Grotesk", system-ui, sans-serif; letter-spacing: .14em; color: var(--x-verm); }
.x-lb__btn { position: absolute; width: 48px; height: 48px; padding: 0; display: grid; place-items: center; background: transparent; color: var(--x-paper); border: 1px solid rgba(241, 236, 226, .4); border-radius: 0; cursor: pointer; }
.x-lb__btn[hidden] { display: none; }
.x-lb__btn:hover { background: var(--x-verm); border-color: var(--x-verm); color: var(--x-ink); }
.x-lb__close { top: 16px; right: 16px; }
.x-lb__prev, .x-lb__next { top: 50%; margin-top: -24px; }
.x-lb__prev { left: 20px; }
.x-lb__next { right: 20px; }
@media (max-width: 639px) {
  .x-lb__prev, .x-lb__next { top: auto; bottom: 20px; margin-top: 0; }
  .x-lb__prev { left: calc(50% - 60px); }
  .x-lb__next { right: calc(50% - 60px); }
  .x-lb__cap { bottom: 84px; }
}

/* 2. magnetic */
html.x-fine .x-mag { transition: translate .6s var(--x-ease); will-change: translate; }
html.x-fine .x-mag.is-pull { transition: translate .15s linear; }

/* 4. spotlight */
html.x-fine .x-spot { position: relative; isolation: isolate; }
html.x-fine .x-spot::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 90, 40, .16), rgba(255, 90, 40, 0) 60%);
  transition: opacity .5s var(--x-ease); }
html.x-fine .x-spot:hover::after { opacity: 1; }

/* 6. inertial scroll needs native smooth off */
html.x-smooth { scroll-behavior: auto !important; }

@media (prefers-reduced-motion: reduce) {
  .x-grain { animation: none; }
  .x-progress, .x-marquee__track { transition: none; }
  .x-lb__bg, .x-lb__cap, .x-lb__btn, .x-shot, .x-thumb, .x-gal-btn { transition: none !important; }
}
