/* Axie-style two-row concept gallery: full-bleed, varied card widths and opposing motion. */
.world-home .world-paper-chapter .works{
  position:relative!important;
  padding:92px 0 92px!important;
  overflow:hidden!important;
}

.works-title-wrap{
  position:relative;
  z-index:7;
  display:flex!important;
  justify-content:center!important;
  align-items:center!important;
  margin:0 auto 48px!important;
  padding:0 20px!important;
}

.works-title-image{
  display:block!important;
  width:clamp(225px,17vw,300px)!important;
  max-width:72vw!important;
  height:auto!important;
  object-fit:contain!important;
}

/* Full viewport width like the reference: cards enter and leave at the screen edges. */
.world-home .world-paper-chapter .works-marquee{
  position:relative;
  width:100vw!important;
  max-width:none!important;
  margin-left:calc(50% - 50vw)!important;
  overflow:hidden!important;
  padding:0 0 8px!important;
}

.works-marquee::before,
.works-marquee::after{
  content:"";
  position:absolute;
  z-index:8;
  top:0;
  bottom:0;
  width:clamp(16px,2.1vw,38px);
  pointer-events:none;
}

.works-marquee::before{
  left:0;
  background:linear-gradient(90deg,rgba(253,237,140,.96),rgba(253,237,140,0));
}

.works-marquee::after{
  right:0;
  background:linear-gradient(270deg,rgba(253,237,140,.96),rgba(253,237,140,0));
}

.work-row{
  width:100%;
  overflow:hidden;
}

.work-row + .work-row{
  margin-top:18px;
}

.work-row-track{
  display:flex;
  align-items:stretch;
  gap:16px;
  width:max-content;
  will-change:transform;
  animation:workMarquee 36s linear infinite;
}

/* Axie reference moves the second row in the opposite direction at the same visual speed. */
.work-row--bottom .work-row-track{
  animation-direction:reverse;
}

.work-set{
  display:flex;
  align-items:stretch;
  gap:16px;
  flex:none;
}

/* Higher specificity intentionally overrides the old static three-card homepage rules. */
.world-home .world-paper-chapter .works .work-row .work-card{
  --work-card-h:clamp(230px,16.5vw,316px);
  flex:none!important;
  height:var(--work-card-h)!important;
  width:clamp(290px,22vw,430px)!important;
  aspect-ratio:auto!important;
  margin:0!important;
  overflow:hidden!important;
  border:8px solid rgba(255,251,232,.98)!important;
  border-radius:23px!important;
  background:#efeee8!important;
  box-shadow:none!important;
}

.world-home .world-paper-chapter .works .work-row .work-card--wide{width:clamp(390px,29vw,560px)!important}
.world-home .world-paper-chapter .works .work-row .work-card--xwide{width:clamp(455px,34vw,650px)!important}
.world-home .world-paper-chapter .works .work-row .work-card--square{width:clamp(230px,17vw,330px)!important}
.world-home .world-paper-chapter .works .work-row .work-card--narrow{width:clamp(195px,14vw,270px)!important}
.world-home .world-paper-chapter .works .work-row .work-card--medium{width:clamp(300px,22vw,430px)!important}

.world-home .world-paper-chapter .works .work-row .work-card img{
  display:block;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
}

/* Concept sheets stay fully visible inside their framed cards. */
.world-home .world-paper-chapter .works .work-row .work-card--concept,
.world-home .world-paper-chapter .works .work-row .work-card--character-concept,
.world-home .world-paper-chapter .works .work-row .work-card--orangutini-concept{
  background:#eeeeef!important;
}

.world-home .world-paper-chapter .works .work-row .work-card--concept img,
.world-home .world-paper-chapter .works .work-row .work-card--character-concept img,
.world-home .world-paper-chapter .works .work-row .work-card--orangutini-concept img{
  object-fit:contain!important;
  background:#eeeeef!important;
}

/* Temporary cards keep the rhythm of the marquee until more real concept art is added. */
.work-card--placeholder{
  position:relative;
  display:grid;
  place-items:center;
  color:#31565e;
  background:
    linear-gradient(135deg,rgba(49,86,94,.05) 25%,transparent 25%) 0 0/34px 34px,
    linear-gradient(315deg,rgba(49,86,94,.04) 25%,transparent 25%) 0 0/34px 34px,
    #f3efe2!important;
}

.work-card--placeholder::before{
  content:"";
  position:absolute;
  inset:22px;
  border:1px dashed rgba(49,86,94,.22);
  border-radius:13px;
}

.work-card--placeholder-dark{
  color:#e8f4ef;
  background:
    linear-gradient(rgba(134,180,178,.08) 1px,transparent 1px) 0 0/28px 28px,
    linear-gradient(90deg,rgba(134,180,178,.08) 1px,transparent 1px) 0 0/28px 28px,
    #31565e!important;
}

.work-card--placeholder-dark::before{border-color:rgba(232,244,239,.24)}

.work-placeholder-copy{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:7px;
  text-align:center;
  padding:24px;
  text-transform:uppercase;
}

.work-placeholder-copy::before{
  content:"✦";
  font-size:27px;
  line-height:1;
  opacity:.5;
}

.work-placeholder-copy strong{
  font:900 15px/1.1 Nunito,system-ui,sans-serif;
  letter-spacing:.08em;
}

.work-placeholder-copy span{
  font:800 9px/1.2 Nunito,system-ui,sans-serif;
  letter-spacing:.18em;
  opacity:.62;
}

@keyframes workMarquee{
  from{transform:translate3d(0,0,0)}
  to{transform:translate3d(calc(-50% - 8px),0,0)}
}

@media(max-height:760px) and (min-width:1001px){
  .world-home .world-paper-chapter .works{padding-top:76px!important;padding-bottom:78px!important}
  .works-title-wrap{margin-bottom:38px!important}
  .works-title-image{width:clamp(215px,15.5vw,275px)!important}
  .world-home .world-paper-chapter .works .work-row .work-card{--work-card-h:clamp(205px,15vw,275px)}
}

@media(max-width:1000px){
  .world-home .world-paper-chapter .works{padding:74px 0 72px!important}
  .works-title-wrap{margin-bottom:34px!important}
  .works-title-image{width:min(285px,62vw)!important}
  .work-row-track,.work-set{gap:12px}
  .work-row + .work-row{margin-top:12px}
  .work-row-track{animation-duration:40s}
  .world-home .world-paper-chapter .works .work-row .work-card{
    --work-card-h:clamp(180px,28vw,232px);
    border-width:7px!important;
    border-radius:19px!important;
  }
  .world-home .world-paper-chapter .works .work-row .work-card--wide{width:clamp(305px,48vw,405px)!important}
  .world-home .world-paper-chapter .works .work-row .work-card--xwide{width:clamp(345px,56vw,470px)!important}
  .world-home .world-paper-chapter .works .work-row .work-card--square{width:clamp(185px,29vw,240px)!important}
  .world-home .world-paper-chapter .works .work-row .work-card--narrow{width:clamp(155px,24vw,205px)!important}
  .world-home .world-paper-chapter .works .work-row .work-card--medium{width:clamp(240px,38vw,320px)!important}
}

@media(max-width:680px){
  .world-home .world-paper-chapter .works{padding:60px 0 56px!important}
  .works-title-wrap{margin-bottom:28px!important}
  .works-title-image{width:min(250px,70vw)!important}
  .works-marquee::before,.works-marquee::after{width:18px}
  .work-row-track{animation-duration:44s}
  .world-home .world-paper-chapter .works .work-row .work-card{
    --work-card-h:152px;
    border-width:6px!important;
    border-radius:16px!important;
  }
  .world-home .world-paper-chapter .works .work-row .work-card--wide{width:260px!important}
  .world-home .world-paper-chapter .works .work-row .work-card--xwide{width:300px!important}
  .world-home .world-paper-chapter .works .work-row .work-card--square{width:156px!important}
  .world-home .world-paper-chapter .works .work-row .work-card--narrow{width:130px!important}
  .world-home .world-paper-chapter .works .work-row .work-card--medium{width:215px!important}
  .work-card--placeholder::before{inset:13px;border-radius:9px}
  .work-placeholder-copy strong{font-size:12px}
  .work-placeholder-copy span{font-size:8px}
}

@media(prefers-reduced-motion:reduce){
  .work-row-track{animation:none!important;transform:none!important}
}

/* Real artwork cards follow each image's own aspect ratio instead of forcing every image into one fixed-width box. */
.world-home .world-paper-chapter .works .work-row .work-card:not(.work-card--placeholder){
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  display:flex!important;
  align-items:stretch!important;
  background:transparent!important;
}

.world-home .world-paper-chapter .works .work-row .work-card:not(.work-card--placeholder) img{
  flex:none!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  height:100%!important;
  object-fit:contain!important;
}

/* These current concept sheets have a few transparent/blank pixels at the bottom of the source canvas.
   A tiny uniform zoom removes that internal strip without stretching the artwork. */
.world-home .world-paper-chapter .works .work-row img[src*="portal-concept-sheet.png"],
.world-home .world-paper-chapter .works .work-row img[src*="pet-store-concept.png"]{
  transform:scale(1.018)!important;
  transform-origin:50% 0!important;
}

/* Latest wooden board concept sketch. Its card is 3:2 like the source artwork.
   Width accounts for the frame thickness, so no background strips appear at the sides and the image is never stretched. */
#in-the-works .work-set::after{
  content:"";
  display:block;
  flex:none;
  height:clamp(230px,16.5vw,316px);
  width:calc(clamp(230px,16.5vw,316px) * 1.5 - 8px);
  box-sizing:border-box;
  border:8px solid rgba(255,251,232,.98);
  border-radius:23px;
  background:transparent url('./assets/gallery/wooden-board-concept-sketch.png?v=2') center/contain no-repeat;
  box-shadow:none;
}

/* Triple T guardian character concept: keep the gallery height identical, but use a wider landscape card.
   Cover scales uniformly, so the artwork fills the longer frame without being stretched. */
#in-the-works .work-set::before{
  content:"";
  display:block;
  flex:none;
  height:clamp(230px,16.5vw,316px);
  width:calc(clamp(230px,16.5vw,316px) * 1.75 - 8px);
  box-sizing:border-box;
  border:8px solid rgba(255,251,232,.98);
  border-radius:23px;
  background:#f3eee5 url('./assets/gallery/triple-t-guardian-character-concept.png?v=2') center/cover no-repeat;
  box-shadow:none;
}

@media(max-height:760px) and (min-width:1001px){
  #in-the-works .work-set::after{
    height:clamp(205px,15vw,275px);
    width:calc(clamp(205px,15vw,275px) * 1.5 - 8px);
  }
  #in-the-works .work-set::before{
    height:clamp(205px,15vw,275px);
    width:calc(clamp(205px,15vw,275px) * 1.75 - 8px);
  }
}

@media(max-width:1000px){
  #in-the-works .work-set::after{
    height:clamp(180px,28vw,232px);
    width:calc(clamp(180px,28vw,232px) * 1.5 - 7px);
    border-width:7px;
    border-radius:19px;
  }
  #in-the-works .work-set::before{
    height:clamp(180px,28vw,232px);
    width:calc(clamp(180px,28vw,232px) * 1.75 - 7px);
    border-width:7px;
    border-radius:19px;
  }
}

@media(max-width:680px){
  #in-the-works .work-set::after{
    height:152px;
    width:222px;
    border-width:6px;
    border-radius:16px;
  }
  #in-the-works .work-set::before{
    height:152px;
    width:260px;
    border-width:6px;
    border-radius:16px;
  }
}
