/* FYNXT Library gallery. Owner: gallery agent. All selectors scoped to #library. */
#library{padding:112px 0 128px;background:var(--paper);overflow:hidden;--ph:340px;scroll-margin-top:var(--header-h,72px)}
#library .lg-head{max-width:760px;margin-bottom:44px}
#library .lg-head .h2{margin:14px 0 18px}
#library .lg-head .lead{margin:0}

#library .lg-controls{display:flex;flex-wrap:wrap;align-items:center;gap:16px 20px;margin-bottom:20px}
#library .lg-chips{position:relative;display:flex;gap:4px;padding:4px;border-radius:999px;background:var(--white);border:1px solid var(--line-light);max-width:100%;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
#library .lg-chips::-webkit-scrollbar{display:none}
#library .lg-ind{position:absolute;left:0;top:4px;bottom:4px;width:100px;border-radius:999px;background:var(--ink);transform-origin:0 50%;pointer-events:none;will-change:transform}
#library .lg-chip{position:relative;z-index:1;flex:none;height:38px;padding:0 16px;border:0;border-radius:999px;background:transparent;color:var(--grey-dark);font-size:14px;font-weight:500;cursor:pointer;white-space:nowrap;transition:color .3s}
#library .lg-chip i{font-style:normal;margin-left:6px;font-size:12px;font-variant-numeric:tabular-nums}
#library .lg-chip:focus-visible{outline-offset:-3px}
#library .lg-chip[aria-pressed="true"]:focus-visible{outline-color:var(--teal)}
#library .lg-chip[aria-pressed="true"]{color:var(--white)}
#library .lg-chip:not([aria-pressed="true"]):hover{color:var(--ink)}
#library .lg-tools{display:flex;gap:12px;margin-left:auto;flex-wrap:wrap}
#library .lg-search{position:relative;display:block}
#library .lg-search svg{position:absolute;left:14px;top:50%;width:16px;height:16px;margin-top:-8px;stroke:var(--grey-dark);fill:none;stroke-width:2;stroke-linecap:round;pointer-events:none}
#library .lg-search input,#library .lg-sort select{height:46px;border-radius:var(--r-btn);border:1px solid var(--line-light);background:var(--white);color:var(--ink);font:inherit;font-size:16px;outline-offset:2px}
#library .lg-search input{width:260px;padding:0 14px 0 40px}
#library .lg-search input::placeholder{color:var(--grey-dark);opacity:1}
#library .lg-sort select{padding:0 14px;cursor:pointer}
#library .lg-search input:focus,#library .lg-sort select:focus{border-color:var(--teal-mid)}
#library .lg-count{font-size:14px;color:var(--grey-dark);margin:0 0 36px;font-variant-numeric:tabular-nums}

#library .lg-grid{position:relative;display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));grid-auto-flow:dense;gap:48px 28px;list-style:none;margin:0;padding:0}
#library .lg-card[hidden]{display:none}
@media (min-width:640px){#library .lg-card.l{grid-column:span 2}}
#library .lg-link{display:block;text-decoration:none;color:inherit;border-radius:var(--r-card)}
#library .lg-link:focus-visible{outline-offset:6px}
#library .lg-panel{position:relative;height:var(--ph);border-radius:var(--r-card);background:var(--wash);border:1px solid var(--line-light);display:flex;align-items:center;justify-content:center;overflow:hidden;perspective:900px;transition:box-shadow .5s var(--ease-out)}
#library .lg-tilt{display:flex;align-items:center;justify-content:center;width:100%;height:100%;will-change:transform;transform-style:preserve-3d}
#library .lg-cv{position:relative;aspect-ratio:var(--r);height:calc(var(--ph) * .78);margin:-8px 8px 0 -8px}
#library .lg-cv.s{height:calc(var(--ph) * .62)}
#library .lg-cv.l{height:auto;width:min(84%,560px);margin:0}
#library .lg-stack{position:absolute;inset:0;border-radius:3px;background:var(--white)}
#library .lg-face{position:absolute;inset:0;border-radius:3px;overflow:hidden;background:var(--white);box-shadow:0 14px 30px -12px rgba(11,13,16,.35),0 2px 6px rgba(11,13,16,.12)}
#library .lg-face img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
#library .lg-face .peek{opacity:0;transition:opacity .45s var(--ease-out)}
#library .lg-face .peek.on{opacity:1}
#library .lg-sheen{position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .4s var(--ease-out);background:radial-gradient(circle at var(--mx,50%) var(--my,30%),rgba(255,255,255,.5),rgba(255,255,255,0) 55%)}
#library .lg-card.on .lg-sheen{opacity:1}
#library .lg-card.on .lg-panel{box-shadow:0 28px 50px -24px rgba(11,13,16,.35)}
#library .lg-t{margin:18px 0 6px;font-size:18px;line-height:1.3;font-weight:600;letter-spacing:-.01em;text-wrap:balance}
#library .lg-cat{font-size:12px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--teal-mid)}
#library .lg-meta{margin-top:4px;font-size:14px;color:var(--grey-dark)}

#library .lg-empty{display:none;text-align:center;padding:72px 24px;border:1px dashed var(--grey);border-radius:var(--r-card);background:var(--white)}
#library .lg-empty.show{display:block}
#library .lg-empty h3{margin:0 0 8px;font-size:22px;font-weight:600}
#library .lg-empty p{margin:0 0 22px;color:var(--grey-dark)}

/* open transition overlay (appended to body, so scoped by its own id) */
#lgOpen{position:fixed;inset:0;z-index:1000;background:var(--ink);opacity:0}
#lgOpenImg{z-index:1001;position:fixed;left:0;top:0;transform-origin:50% 50%;border-radius:3px;box-shadow:0 30px 80px rgba(0,0,0,.5);object-fit:cover}
#lgOpen .bar{position:absolute;left:0;right:0;bottom:0;height:3px;background:rgba(140,153,163,.18)}
#lgOpen .bar i{display:block;height:100%;background:var(--teal);transform:scaleX(0);transform-origin:0 50%}

@media (pointer:coarse){#library .lg-chip{height:44px}}
@media (max-width:640px){
  #library{padding:80px 0 96px;--ph:300px}
  #library .lg-tools{width:100%;margin-left:0}
  #library .lg-search{flex:1 1 100%}
  #library .lg-search input{width:100%}
  #library .lg-sort{flex:1 1 100%}
  #library .lg-sort select{width:100%}
}
