/* ==========================================================================
   Architive – portfolio: lightbox, galleries, sample-set cards, video, case media, mosaic
   ========================================================================== */

/* ---- Lightbox ------------------------------------------------------------ */
html.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 3000; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(8, 8, 8, .95); color: #fff; opacity: 0; transition: opacity .25s ease; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lb[hidden] { display: none; }
.lb.is-open { opacity: 1; }
.lb__bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: max(.8rem, env(safe-area-inset-top)) 1rem .6rem; }
.lb__count { font: 500 .75rem/1 var(--f-mono); letter-spacing: .14em; color: #bdbdb5; }
.lb__tools { display: flex; gap: .5rem; }
.lb__btn, .lb__nav { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; transition: background .3s, transform .4s var(--ease), color .3s; }
.lb__btn:hover, .lb__nav:hover { background: var(--accent); border-color: var(--accent); color: #141414; }
.lb__nav { width: 50px; height: 50px; margin: 0 .8rem; align-self: center; grid-row: 2; }
.lb__prev { grid-column: 1; } .lb__next { grid-column: 3; }
.lb__stage { grid-row: 2; grid-column: 2; position: relative; display: flex; overflow: auto; min-height: 0; cursor: zoom-in; overscroll-behavior: contain; touch-action: pan-y; }
.lb__img { display: block; margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; transition: opacity .3s; -webkit-user-drag: none; user-select: none; }
.lb.is-loading .lb__img { opacity: .15; }
.lb__spin { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--accent); animation: spin .8s linear infinite; opacity: 0; transition: opacity .2s; pointer-events: none; }
.lb.is-loading .lb__spin { opacity: 1; }
.lb.is-zoomed .lb__stage { cursor: grab; touch-action: auto; }
.lb.is-dragging .lb__stage { cursor: grabbing; }
.lb.is-zoomed .lb__img { max-width: none; max-height: none; width: auto; height: auto; }
.lb__cap { grid-column: 1 / -1; padding: .8rem 1rem max(1.1rem, env(safe-area-inset-bottom)); text-align: center; }
.lb__title { display: block; font: 400 1.15rem/1.3 var(--f-display); }
.lb__sub { display: block; margin-top: .25rem; font: 400 .7rem/1.5 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: #bdbdb5; }
.lb.is-single .lb__nav { display: none; }
@media (max-width: 767.98px) {
  .lb { grid-template-columns: 1fr; }
  .lb__stage { grid-column: 1; }
  .lb__nav { position: absolute; z-index: 2; top: 50%; margin: 0; width: 42px; height: 42px; background: rgba(0, 0, 0, .5); transform: translateY(-50%); }
  .lb__prev { left: .4rem; } .lb__next { right: .4rem; }
}

/* ---- Work gallery (masonry via CSS columns: keeps each image's real aspect ratio) --- */
.work-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; margin-bottom: 1.6rem; }
.work-toolbar .filters { margin: 0; justify-content: flex-start; }
.work-count { font: 500 .72rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.work-count b { color: var(--ink); }
.work-grid { column-count: 3; column-gap: 1rem; list-style: none; padding: 0; margin: 0; }
.work-item { break-inside: avoid; margin: 0 0 1rem; }
.work-item.is-hidden { display: none; }
.work-item > a { position: relative; display: block; overflow: hidden; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.work-item img { display: block; width: 100%; height: auto; transition: transform 1.3s var(--ease); }
.work-item > a:hover img, .work-item > a:focus-visible img { transform: scale(1.05); }
.work-item__cap { position: absolute; inset: auto 0 0 0; display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem; padding: 3rem 1rem .9rem; color: #fff; background: linear-gradient(0deg, rgba(8, 8, 8, .86), rgba(8, 8, 8, 0)); opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.work-item > a:hover .work-item__cap, .work-item > a:focus-visible .work-item__cap { opacity: 1; transform: none; }
.work-item__cap strong { display: block; font: 400 1.05rem/1.25 var(--f-display); }
.work-item__cap small { display: block; margin-top: .2rem; font: 700 .6rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.work-item__cap i { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #141414; font-size: .95rem; }
@media (hover: none) { .work-item__cap { opacity: 1; transform: none; } }
@media (max-width: 991.98px) { .work-grid { column-count: 2; } }
@media (max-width: 575.98px) { .work-grid { column-count: 1; } }
.note-line { margin: 1.4rem 0 0; font: 400 .72rem/1.6 var(--f-mono); letter-spacing: .02em; color: var(--ink-3); }
.filters--left { justify-content: flex-start; margin-bottom: 1rem; }

/* ---- Sample sets (permit sheets, Revit / scan-to-BIM) --------------------- */
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.set-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.set-card { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .6s var(--ease), box-shadow .6s var(--ease), border-color .4s; }
.set-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.set-card__media { position: relative; display: block; aspect-ratio: 3 / 2; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.set-card__media img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform 1.2s var(--ease); }
.set-card:hover .set-card__media img { transform: scale(1.06); }
.set-card__badge { position: absolute; left: .9rem; top: .9rem; padding: .42rem .7rem; border-radius: 999px; background: #141414; color: #fff; font: 700 .6rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; }
.set-card__zoom { position: absolute; right: .9rem; bottom: .9rem; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #141414; font-size: 1rem; transition: transform .5s var(--ease); }
.set-card:hover .set-card__zoom { transform: scale(1.12) rotate(8deg); }
.set-card__body { display: flex; flex-direction: column; gap: .75rem; padding: 1.4rem 1.5rem 1.5rem; flex: 1; }
.set-card__place { margin: 0; font: 700 .64rem/1.4 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); }
[data-theme="dark"] .set-card__place { color: var(--accent); }
.set-card h3 { margin: 0; font: 400 1.5rem/1.25 var(--f-display); }
.set-card__sum { margin: 0; font-size: .9rem; color: var(--ink-2); line-height: 1.65; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li { padding: .32rem .65rem; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line); font: 500 .64rem/1.2 var(--f-mono); letter-spacing: .04em; }
.set-card__strip { display: flex; gap: .5rem; overflow-x: auto; padding: .15rem .1rem .45rem; margin-top: auto; scrollbar-width: thin; }
.set-card__strip a { flex: none; width: 82px; aspect-ratio: 3 / 2; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: #fff; transition: border-color .3s, transform .4s var(--ease); }
.set-card__strip a:hover { border-color: var(--accent); transform: translateY(-3px); }
.set-card__strip img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.set-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.set-card__foot small { font: 400 .66rem/1.4 var(--f-mono); color: var(--ink-3); }
@media (max-width: 1199.98px) { .set-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .set-grid, .set-grid--3 { grid-template-columns: minmax(0, 1fr); } }

/* ---- Video + case-study media -------------------------------------------- */
.video-card { margin: 0; overflow: hidden; border-radius: var(--r-lg); background: #0b0b0b; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.video-card video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }
.video-card figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; padding: .9rem 1.2rem; color: #d7d7cf; font: 400 .7rem/1.5 var(--f-mono); letter-spacing: .06em; }

.case-cover { display: block; overflow: hidden; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md); position: relative; }
.case-cover img { display: block; width: 100%; height: auto; transition: transform 1.2s var(--ease); }
.case-cover:hover img { transform: scale(1.04); }
.case-cover__tag { position: absolute; left: .9rem; bottom: .9rem; padding: .45rem .75rem; border-radius: 999px; background: #141414; color: #fff; font: 700 .6rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; }
.case-cover--hero { border-color: rgba(255, 255, 255, .25); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7); }

.collab-card__art--photo { padding: .7rem .7rem .9rem; }
.collab-card__art--photo .collab-card__row { padding-inline: .6rem; }
.collab-card__photo { display: block; margin: .6rem 0; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); aspect-ratio: 16 / 10; }
.collab-card__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.collab-card:hover .collab-card__photo img { transform: scale(1.06); }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.6rem; }
.duo figure { margin: 0; position: relative; overflow: hidden; border-radius: var(--r-md); border: 1px solid var(--line); background: #000; }
.duo img { display: block; width: 100%; height: auto; }
.duo figcaption { position: absolute; left: .8rem; top: .8rem; padding: .4rem .65rem; border-radius: 999px; background: rgba(12, 12, 12, .75); color: #fff; font: 700 .58rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.duo figure:last-child figcaption { background: var(--accent); color: #141414; }
@media (max-width: 575.98px) { .duo { grid-template-columns: 1fr; } }

/* ---- Home: selected-work mosaic ------------------------------------------- */
.mosaic { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 17vw, 230px); gap: 1rem; }
.mosaic__tile { position: relative; display: block; overflow: hidden; border-radius: var(--r-md); background: #1b1b1a; border: 1px solid var(--line); isolation: isolate; }
.mosaic__tile:nth-child(1) { grid-column: 1 / span 7; grid-row: 1 / span 2; }
.mosaic__tile:nth-child(2) { grid-column: 8 / span 5; }
.mosaic__tile:nth-child(3) { grid-column: 8 / span 5; }
.mosaic__tile:nth-child(4) { grid-column: 1 / span 5; }
.mosaic__tile:nth-child(5) { grid-column: 6 / span 7; }
.mosaic__tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform 1.4s var(--ease); }
.mosaic__tile--light img { background: #fff; object-fit: contain; }
.mosaic__tile:hover img { transform: scale(1.06); }
.mosaic__tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(8, 8, 8, .78), rgba(8, 8, 8, 0) 55%); }
.mosaic__tile--light::after { background: linear-gradient(0deg, rgba(8, 8, 8, .82), rgba(8, 8, 8, 0) 42%); }
.mosaic__cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: .8rem; padding: 1.1rem 1.2rem; color: #fff; }
.mosaic__cap small { display: block; margin-bottom: .25rem; font: 700 .6rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.mosaic__cap strong { font: 400 clamp(1.05rem, 1.6vw, 1.4rem)/1.2 var(--f-display); }
.mosaic__go { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #141414; transition: transform .5s var(--ease); }
.mosaic__tile:hover .mosaic__go { transform: rotate(45deg) scale(1.1); }
@media (max-width: 767.98px) {
  .mosaic { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 210px; }
  .mosaic__tile:nth-child(n) { grid-column: 1; grid-row: auto; }
  .mosaic__tile:nth-child(1) { grid-row: span 2; }
}

/* two default-background sections in a row: don't double the gap */
.section--flush-top { padding-top: clamp(1rem, 3vw, 2rem); }
