/* Site updates — construction media library */
#media-lib { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; color: var(--paper, #f4f4f6); font-family: var(--sans);
  background: radial-gradient(120% 90% at 20% 0%, #1f1f24 0%, #14111a 55%, #0c0a10 100%); overflow: hidden; }
#media-lib { --x: 0; }
:where(#media-lib button) { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
#media-lib h2, #media-lib h3 { font-family: var(--sans); font-weight: 400; letter-spacing: -.01em; }
.ml-k { font-size: max(12px, .72rem); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); display: block; }

.ml-top { display: flex; align-items: center; gap: 1.6rem; padding: calc(var(--pad) * .8 + var(--safe-t, 0px)) calc(var(--pad) + var(--safe-r, 0px)) .9rem calc(var(--pad) + var(--safe-l, 0px)); flex: none; }
.ml-brand h2 { font-size: clamp(1.7rem, 2.4vw, 2.5rem); line-height: 1; margin-top: .35rem; }
.ml-filters { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: .3rem .2rem; margin-left: 1rem; }
.ml-filters::-webkit-scrollbar { display: none; }
.ml-sep { width: 1px; height: 1.8rem; background: rgba(255,255,255,.18); margin: 0 .5rem; flex: none; }
.ml-chip { flex: none; min-height: var(--tap); padding: 0 1.4rem; border-radius: 99px; font-weight: 600; font-size: .95rem; letter-spacing: .02em;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: rgba(244,239,230,.82); transition: background .28s var(--ease), color .28s, border-color .28s; }
.ml-chip.on { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.ml-sample { flex: none; font-size: max(12px, .68rem); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: .55rem .9rem; border-radius: 99px;
  color: var(--gold-2); border: 1px solid rgba(255, 255, 255,.45); background: rgba(255, 255, 255,.08); }
.ml-x { flex: none; width: 3.4rem; height: 3.4rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.22) !important; color: #fff; backdrop-filter: blur(10px); transition: background .24s; }
.ml-x:hover, .ml-x:active { background: rgba(255,255,255,.24) !important; }

.ml-body { flex: 1; min-height: 0; display: grid; grid-template-columns: clamp(15rem, 21vw, 22rem) 1fr; gap: 0; }
.ml-tl { position: relative; overflow-y: auto; padding: .6rem 1rem 3rem calc(var(--pad) + var(--safe-l, 0px)); scrollbar-width: none; }
.ml-tl::-webkit-scrollbar { display: none; }
.ml-rail { position: absolute; left: calc(var(--pad) + var(--safe-l, 0px) + .46rem); top: 2rem; bottom: 3rem; width: 1px; background: linear-gradient(rgba(255, 255, 255,.5), rgba(255,255,255,.08)); }
.ml-m { position: relative; display: block; width: 100%; text-align: left; min-height: var(--tap); padding: 1rem 1rem 1rem 2.1rem; margin-bottom: .3rem; border-radius: 1.1rem; transition: background .32s var(--ease); }
.ml-m:hover { background: rgba(255,255,255,.04); }
.ml-m.on { background: rgba(255, 255, 255,.12); }
.ml-dot { position: absolute; left: .1rem; top: 1.55rem; width: .75rem; height: .75rem; border-radius: 50%; background: #14111a; border: 1px solid rgba(255,255,255,.4); transition: opacity .32s var(--ease), transform .32s var(--ease), background-color .32s var(--ease), border-color .32s var(--ease), color .32s var(--ease); }
.ml-m.on .ml-dot { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 .35rem rgba(255, 255, 255,.2); }
.ml-mo { display: block; font-size: max(12px, .74rem); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(244,239,230,.55); }
.ml-m.on .ml-mo { color: var(--gold); }
.ml-mt { display: block; font-family: var(--sans); font-size: 1.3rem; line-height: 1.12; margin-top: .3rem; color: rgba(244,239,230,.9); }
.ml-mc { display: block; font-size: max(12px, .78rem); color: rgba(244,239,230,.42); margin-top: .35rem; }

.ml-main { overflow-y: auto; overscroll-behavior: contain; padding: .4rem calc(var(--pad) + var(--safe-r, 0px)) 3rem 1rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ml-main::-webkit-scrollbar { display: none; }
.ml-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: end; margin-bottom: 1.5rem; }
.ml-head h3 { font-size: clamp(2.2rem, 3.6vw, 3.8rem); line-height: 1.02; margin-top: .5rem; }
.ml-head p { color: rgba(244,239,230,.68); line-height: 1.55; font-size: 1.05rem; max-width: 34rem; }
.ml-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; grid-auto-flow: dense; }
.ml-grid.feat .ml-tile:first-child { grid-column: span 2; grid-row: span 2; }
.ml-tile { position: relative; overflow: hidden; border-radius: 1.2rem; aspect-ratio: 16 / 10; background: #0c0a10; padding: 0 !important; box-shadow: 0 1rem 2.4rem -1rem rgba(0,0,0,.7); text-align: left; }
.ml-grid.feat .ml-tile:first-child { aspect-ratio: auto; min-height: 100%; }
.ml-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .96s var(--ease), filter .4s; user-select: none; -webkit-user-drag: none; }
.ml-tile:hover img, .ml-tile:active img { transform: scale(1.04); }
.ml-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(8,6,10,.7)); pointer-events: none; }
.ml-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.ml-cap { position: absolute; left: 1rem; right: 6.5rem; top: .9rem; z-index: 2; font-size: max(12px, .85rem); font-weight: 600; line-height: 1.25; text-shadow: 0 1px 12px rgba(0,0,0,.7); display: flex; flex-direction: column; gap: .3rem; opacity: 0; transform: translateY(-.3rem); transition: opacity .32s var(--ease), transform .32s var(--ease), background-color .32s var(--ease), border-color .32s var(--ease), color .32s var(--ease); }
.ml-tile:hover .ml-cap, .ml-tile:focus-visible .ml-cap { opacity: 1; transform: none; }
.ml-cap em { font-style: normal; font-size: max(12px, .62rem); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); }
.ml-play { position: absolute; z-index: 2; right: .9rem; top: .9rem; display: inline-flex; align-items: center; gap: .55rem; height: 2.6rem; padding: 0 1rem 0 .85rem; border-radius: 99px;
  background: rgba(14,11,16,.62); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(8px); font-size: max(12px, .85rem); }
.ml-play b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ml-tile.vid::before { content: ""; position: absolute; z-index: 1; left: 50%; top: 50%; width: 4.4rem; height: 4.4rem; margin: -2.2rem 0 0 -2.2rem; border-radius: 50%;
  background: rgba(14,11,16,.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M9 6.5v11l9-5.5z'/%3E%3C/svg%3E") center / 46% no-repeat;
  border: 1px solid rgba(255,255,255,.4); backdrop-filter: blur(6px); pointer-events: none; }
.ml-empty { grid-column: 1 / -1; color: rgba(244,239,230,.5); padding: 3rem 0; }
/* while a photo is on its way (js/media.js arrive): it waits hidden and a soft band crosses its tile, started by the tile's x (--ml-d) so the
   grid reads as one sweep. Transform only, and bounded: six passes at most (a lazy photo below the fold never keeps a loop running), gone the
   moment the photo decodes. A cached photo never gets .ml-ld. */
.ml-shim { display: none; position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ml-tile.ml-ld .ml-shim { display: block; }
.ml-tile.ml-ld img { opacity: 0; }
.ml-shim::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 60%; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 16%, rgba(255,255,255,.06) 38%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.06) 62%, transparent 84%);   /* clear 16% in from each end: at 100deg the band's corners would otherwise show a faint hard edge */
  animation: ml-shim 1.6s cubic-bezier(.65, 0, .35, 1) var(--ml-d, .12s) 6; }
@keyframes ml-shim { 0% { transform: translateX(-120%); } 70%, 100% { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .ml-shim::before { animation: none; } }

/* viewer */
/* the black ground is its own layer (.mv-bg), so a photo can zoom out of its tile over the grid while the ground fades up behind it (js/media.js openViewer) */
.ml-viewer { position: absolute; inset: 0; z-index: 5; background: transparent; }
.mv-bg { position: absolute; inset: 0; background: #000; pointer-events: none; }
.ml-viewer[hidden] { display: none; }
.mv-stage { position: absolute; inset: 0 0 6.2rem 0; overflow: visible; touch-action: pan-y; }   /* visible: a photo zooming to or from a low tile passes under the caption bar instead of being cut at its edge (#media-lib clips the screen) */
.mv-slide { position: absolute; inset: 0; }
.mv-slide img, .mv-slide video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; user-select: none; -webkit-user-drag: none; }   /* transparent: the letterbox is the ground, so the zooming picture carries no black frame */
.mv-x { position: absolute; right: calc(var(--pad) + var(--safe-r, 0px)); top: calc(var(--pad) * .8 + var(--safe-t, 0px)); z-index: 3; }
.mv-a { position: absolute; top: 50%; margin-top: -1.9rem; z-index: 3; width: 3.8rem; height: 3.8rem; border-radius: 50%; display: grid; place-items: center; background: rgba(20,17,26,.55) !important;
  border: 1px solid rgba(255,255,255,.25) !important; color: #fff; backdrop-filter: blur(10px); transition: background .24s, opacity .24s; }
.mv-a:hover, .mv-a:active { background: rgba(255,255,255,.22) !important; }
.mv-a.prev { left: calc(var(--pad) + var(--safe-l, 0px)); } .mv-a.next { right: calc(var(--pad) + var(--safe-r, 0px)); }
.mv-a.dis { opacity: 0; pointer-events: none; }
.mv-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 6.2rem; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 2rem; pointer-events: none; background: #000;
  padding: 0 calc(var(--pad) * 2 + 4rem) var(--safe-b, 0px); border-top: 1px solid rgba(255,255,255,.08); }
.mv-bar p { font-family: var(--sans); font-size: clamp(1.3rem, 1.9vw, 2rem); line-height: 1.1; margin-top: .4rem; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.mv-n { align-self: center; font-variant-numeric: tabular-nums; font-size: .95rem; letter-spacing: .12em; color: rgba(244,239,230,.8); padding-top: .2rem; white-space: nowrap; }

@media (max-width: 1100px) {
  .ml-body { grid-template-columns: 13rem 1fr; }
  .ml-head { grid-template-columns: 1fr; gap: .8rem; }
  .ml-mt { font-size: 1.1rem; }
  .ml-sample { display: none; }
  .ml-grid.feat .ml-tile:first-child { grid-column: span 2; grid-row: span 1; aspect-ratio: 16 / 8; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { #media-lib * { transition: none !important; } }
