/* Native horizontal image gallery. The image plane and captions stay separate. */
#decode { --rice:#ece3d0; --gold:#cfb17b; position:relative; isolation:isolate; background:#0b2024; color:var(--rice); padding:100px 0 42px; min-height:100svh; overflow:clip; scroll-margin:0; }
#decode::before { content:''; position:absolute; inset:0; height:auto; z-index:-2; background:linear-gradient(#0b2024cc,#07191eef),url('../assets/backgrounds/encounter-lakeshore.webp') center/cover; filter:none; }
#decode .decode-inner { width:100%; margin:0; timeline-scope:--decode-scroll; }
#decode .section-heading { padding-inline:24px; margin:0 auto 10px; max-width:730px; text-align:center; }
#decode .section-heading h2 { margin:0; font:400 clamp(2rem,4vw,3.8rem)/1.3 Painting,'Songti SC',serif; letter-spacing:.12em; }
#decode .section-heading p { margin:14px auto 0; font-size:16px; line-height:1.8; color:#b8c1b5; }
.decode-instruction { margin:10px 24px 0; text-align:center; color:#a3b2a9; font-size:14px; line-height:1.7; }
#decode .decode-list { --card-width:clamp(238px,62vw,440px); display:flex; align-items:start; gap:0; width:100%; margin:0; padding:26px calc((100% - var(--card-width))/2) 14px; list-style:none; overflow-x:auto; overflow-y:hidden; scroll-snap-type:x mandatory; scroll-padding-inline:calc((100% - var(--card-width))/2); overscroll-behavior-x:contain; scrollbar-width:none; scroll-timeline:--decode-scroll inline; -webkit-overflow-scrolling:touch; }
#decode .decode-list::-webkit-scrollbar { display:none; }
#decode .decode-list>li { flex:0 0 var(--card-width); min-width:0; position:relative; margin:0; padding:0; scroll-snap-align:center; scroll-snap-stop:always; scroll-margin-block-start:190px; transform-origin:50% 45%; opacity:1; translate:none; animation:none; }
#decode .decode-list>li:not(:last-child) { margin-right:calc(var(--card-width)*-.1); }
#decode .decode-card { position:relative; display:block; width:100%; height:auto; min-height:0; padding:0; color:#f1e4cd; background:transparent; border:0; border-radius:0; box-shadow:none; overflow:visible; transform:none; transition:none; text-decoration:none; }
#decode .decode-card::after { display:none; }
#decode .decode-visual { display:block; position:relative; height:clamp(270px,40svh,450px); overflow:hidden; background:#172e30; isolation:isolate; box-shadow:0 22px 38px #0005; transition:transform .4s ease,box-shadow .4s ease; }
#decode .decode-visual::after { content:''; position:absolute; inset:0; pointer-events:none; border:1px solid #d2bb822f; background:linear-gradient(0deg,#061c2180,transparent 40%); }
#decode .decode-card .decode-card-backdrop { position:absolute; z-index:-1; inset:0; width:100%; height:100%; object-fit:cover; opacity:.5; filter:saturate(.7) brightness(.8); }
#decode .decode-card .decode-subject { position:absolute; width:90%; height:82%; left:5%; top:9%; object-fit:contain; filter:drop-shadow(0 16px 16px #0009); transition:transform .45s ease; }
#decode .decode-slide-human .decode-subject { width:115%; max-width:none; left:-7.5%; height:90%; top:5%; }
#decode .decode-slide-underworld .decode-subject { height:94%; top:3%; }
#decode .decode-caption { display:block; padding:24px 14px 0; text-align:center; }
#decode .decode-label { display:block; }
#decode .decode-label small { display:block; margin:0 0 9px; color:#c6aa77; font-size:14px; line-height:1.5; letter-spacing:.25em; }
#decode .decode-q { display:block; color:#f1e4cd; font:400 clamp(20px,2vw,28px)/1.45 'Songti SC',serif; }
#decode .decode-description { display:block; margin:12px auto 0; max-width:26rem; font-size:14px; line-height:1.75; color:#a8b8ae; }
#decode .decode-go { display:block; margin:12px 0 0; padding:0; border:0; opacity:1; font-size:14px; color:#d5bd8c; line-height:1.8; letter-spacing:.12em; }
#decode .decode-go>span { margin-left:8px; }
#decode .decode-card:hover .decode-visual { transform:translateY(-5px); box-shadow:0 25px 45px #0008; }
#decode .decode-card:hover .decode-subject { transform:scale(1.035); }
#decode .decode-card:focus-visible { outline:2px solid #e5c58d; outline-offset:6px; transform:none; }
#decode .decode-list>li:focus-within { z-index:20; }
#decode .decode-card:active .decode-visual { filter:brightness(1.12); }
.decode-browse { width:min(520px,82%); margin:20px auto 0; text-align:center; }
.decode-progress { height:2px; background:#c1b08340; overflow:hidden; }
.decode-progress span { display:block; width:20%; height:100%; background:#e0c18b; }
.decode-stops { display:flex; justify-content:space-between; gap:6px; margin-top:8px; }
.decode-stops a { display:grid; place-items:center; min-height:44px; min-width:44px; font-size:14px; color:#baaf93; }
.decode-stops a:hover,.decode-stops a:focus-visible { color:#ffe1a4; text-decoration:underline; text-underline-offset:6px; }
.decode-browse>p { margin:4px 0 0; font-size:12px; color:#8d9f97; letter-spacing:.1em; }
@supports (animation-timeline:view(inline)) {
 #decode .decode-list>li { animation:decode-depth linear both; animation-timeline:view(inline); animation-range:cover 0% cover 100%; }
 .decode-progress span { animation:decode-distance linear both; animation-timeline:--decode-scroll; }
}
@keyframes decode-depth {
 0%,100% { scale:.78; translate:0 35px; filter:brightness(.6); z-index:1; }
 45%,55% { scale:1; translate:0 0; filter:brightness(1); z-index:5; }
}
@keyframes decode-distance { from { transform:translateX(0); } to { transform:translateX(400%); } }
@media (min-width:1100px) {
 #decode .decode-list { --card-width:380px; padding-top:38px; }
 #decode .decode-visual { height:min(47svh,440px); }
 #decode .decode-list>li:not(:last-child) { margin-right:-28px; }
}
@media (max-width:760px) {
 #decode { padding-top:90px; padding-bottom:30px; }
 #decode .section-heading p { font-size:14px; max-width:24rem; margin-top:10px; }
 .decode-instruction { font-size:12px; }
 #decode .decode-list { padding-top:23px; }
 #decode .decode-visual { height:36svh; min-height:260px; }
 #decode .decode-caption { padding:18px 8px 0; }
 #decode .decode-label small { margin-bottom:5px; }
 #decode .decode-description { font-size:14px; line-height:1.65; margin-top:8px; }
 #decode .decode-go { margin-top:8px; }
 .decode-browse { margin-top:14px; }
}
@media (prefers-reduced-motion:reduce) {
 #decode .decode-list>li { animation:none!important; scale:1; filter:none; translate:none; }
 #decode .decode-list>li:not(:last-child) { margin-right:18px; }
 #decode .decode-visual { transition:none; }
 .decode-progress span { animation:none; }
}

/* Image-led overlapping gallery: wide exposed wings and quiet captions. */
#decode .decode-list { --card-width:clamp(220px,56vw,410px); padding-block:42px 30px; align-items:start; }
#decode .decode-list>li:not(:last-child) { margin-right:calc(var(--card-width)*-.16); }
#decode .decode-visual { background:transparent; overflow:visible; box-shadow:none; }
#decode .decode-visual::after { border:0; background:none; }
#decode .decode-card .decode-card-backdrop { opacity:.22; mask-image:linear-gradient(transparent,#000 20% 80%,transparent); }
#decode .decode-card .decode-subject { width:100%; left:0; height:96%; top:2%; }
#decode .decode-caption { padding-top:16px; }
#decode .decode-description { max-width:20rem; font-size:14px; }
#decode .decode-q { font-size:clamp(19px,2vw,27px); }
#decode .decode-card:hover .decode-visual { box-shadow:none; }
@keyframes decode-depth {
 0%,100% { scale:.72; translate:0 40px; filter:brightness(.55); z-index:1; }
 30%,70% { scale:.86; translate:0 18px; filter:brightness(.78); z-index:2; }
 48%,52% { scale:1.08; translate:0 0; filter:brightness(1); z-index:6; }
}
@media(min-width:1100px) { #decode .decode-list { --card-width:420px; } }
@media(max-width:760px) {
 #decode .decode-list { --card-width:58vw; }
 #decode .decode-visual { height:35svh; min-height:230px; }
 #decode .decode-description { max-width:18rem; }
}
@media(prefers-reduced-motion:reduce) { #decode .decode-list>li:not(:last-child) { margin-right:20px; } }
