/* Keechi Creek Builders — the gallery: every photograph of a house, full screen.
   Opens like the door in the logo (a slit that widens) or flies out of the photo you
   clicked; ← → to move, Esc or a click outside the photograph to close, swipe on touch. */

html.gal-open { overflow: hidden; }

.gal { position: fixed; inset: 0; z-index: 150; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: var(--paper); overscroll-behavior: contain; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.gal__veil { position: absolute; inset: 0; z-index: -1; background: radial-gradient(130% 95% at 50% 42%, #26304d 0%, #171c2c 62%, #12151f 100%); opacity: 0; transition: opacity .45s var(--ease); }
.gal.is-open .gal__veil { opacity: 1; }

/* -- the house, top ---------------------------------------------------- */
.gal__top { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: 18px clamp(20px, 3vw, 56px); padding: 20px var(--gut) 12px; }
.gal__kicker { color: var(--brass-2); }
.gal__title { margin-top: 8px; font-family: var(--serif); font-weight: 380; font-stretch: 104%; font-variation-settings: 'opsz' 320; font-size: clamp(30px, 3.1vw, 50px); line-height: 1; letter-spacing: -.012em; }
.gal__awards { display: grid; gap: 5px; padding-top: 3px; font-size: 12.5px; line-height: 1.35; color: rgba(243, 238, 230, .72); max-width: 420px; }
.gal__awards li { display: grid; grid-template-columns: 78px 1fr; gap: 10px; transition: color .4s, opacity .4s; }
.gal__awards b { font-family: var(--wide); font-stretch: 115%; font-weight: 500; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--brass-2); padding-top: 2px; }
.gal__awards li.is-here { color: var(--paper); }
.gal__awards li.is-here span::after { content: '  ◆'; color: var(--brass-2); }
.gal__awards.has-here li:not(.is-here) { opacity: .45; }
.gal__close { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 7px 0 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(243, 238, 230, .34); font-size: 13px; letter-spacing: .04em; transition: background-color .3s, color .3s; }
.gal__close:hover { background: var(--paper); color: var(--ink); }
.gal__close kbd { font-family: var(--wide); font-size: 9px; letter-spacing: .14em; padding: 5px 8px; border-radius: 99px; background: rgba(243, 238, 230, .13); }
.gal__close:hover kbd { background: rgba(28, 37, 64, .1); }

/* -- the photographs ---------------------------------------------------- */
.gal__stage { position: relative; overflow: hidden; }
.gal__track { display: flex; height: 100%; will-change: transform; }
.gal__track.is-anim { transition: transform .78s var(--ease); }
.gal__slide { flex: 0 0 100%; height: 100%; display: grid; place-items: center; padding: 4px clamp(16px, 7.5vw, 132px); container-type: size; }
.gal__frame { position: relative; width: min(100cqw, 100cqh * var(--ar), var(--nw) * 1.6px); aspect-ratio: var(--ar); overflow: hidden; border-radius: 3px; background: rgba(243, 238, 230, .05); box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .7); cursor: pointer; clip-path: inset(0 0 0 0); transition: transform .8s var(--ease), opacity .6s var(--ease), clip-path 1.05s var(--ease); }
.gal__slide:not(.is-on) .gal__frame { transform: scale(.9); opacity: .28; }
.gal__ph, .gal__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.gal__ph { filter: blur(14px); transform: scale(1.08); }
.gal__img { opacity: 0; transition: opacity .55s var(--ease); }
.gal__img.is-loaded { opacity: 1; }
/* opening: the photograph appears through a slit that widens, like the door in the K */
.gal:not(.is-open):not(.is-flip) .gal__slide.is-on .gal__frame { clip-path: inset(0 49.5% 0 49.5%); }
.gal.is-closing .gal__slide.is-on .gal__frame { transform: scale(.96); opacity: 0; transition-duration: .35s; }
.gal__fly { position: fixed; z-index: 6; margin: 0; object-fit: cover; pointer-events: none; border-radius: 4px; box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .7); }

.gal__arrow { position: absolute; top: 50%; z-index: 3; width: 56px; height: 56px; margin-top: -28px; border-radius: 50%; display: grid; place-items: center; color: var(--paper); box-shadow: inset 0 0 0 1px rgba(243, 238, 230, .3); background: rgba(18, 21, 31, .25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background-color .3s, color .3s, opacity .45s var(--ease), transform .6s var(--ease); }
.gal__arrow--prev { left: clamp(14px, 2.2vw, 40px); }
.gal__arrow--next { right: clamp(14px, 2.2vw, 40px); }
.gal__arrow svg { width: 22px; height: 22px; }
.gal__arrow:hover { background: var(--paper); color: var(--ink); }
.gal__arrow--prev:hover svg { transform: translateX(-2px); }
.gal__arrow--next:hover svg { transform: translateX(2px); }
.gal__arrow svg { transition: transform .4s var(--ease); }

.gal__cursor { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; padding: 7px 12px 6px; border-radius: 99px; background: var(--paper); color: var(--ink); font-family: var(--wide); font-stretch: 115%; font-weight: 500; font-size: 9.5px; letter-spacing: .17em; text-transform: uppercase; white-space: nowrap; opacity: 0; transform: translate(14px, 16px) scale(.85); transform-origin: 0 0; transition: opacity .2s, transform .35s var(--ease); }
.gal__cursor.is-on { opacity: 1; transform: translate(14px, 16px) scale(1); }

/* -- caption, count and the strip, bottom --------------------------------- */
.gal__foot { position: relative; z-index: 2; display: grid; gap: 12px; padding: 10px var(--gut) 16px; }
.gal__meta { display: flex; align-items: baseline; gap: 10px 22px; flex-wrap: wrap; min-height: 26px; }
.gal__count { display: flex; align-items: center; gap: 9px; font-family: var(--wide); font-size: 12px; letter-spacing: .1em; font-variant-numeric: tabular-nums; color: rgba(243, 238, 230, .55); }
.gal__count b { font-weight: 500; color: var(--paper); }
.gal__count i { width: 24px; height: 1px; background: currentColor; opacity: .6; }
.gal__room { font-family: var(--serif); font-style: italic; font-weight: 400; font-variation-settings: 'opsz' 120; font-size: 20px; line-height: 1.2; }
.gal__award { font-family: var(--wide); font-stretch: 115%; font-weight: 500; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--brass-2); }
.gal__award:empty { display: none; }
.gal__award::before { content: '◆  '; }
.gal__strip { position: relative; display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 0 2px; touch-action: pan-x; }
.gal__strip::-webkit-scrollbar { display: none; }
.gal__thumb { position: relative; flex: none; height: 54px; aspect-ratio: var(--ar); max-width: 92px; min-width: 36px; border-radius: 2px; overflow: hidden; opacity: .36; transition: opacity .3s, transform .45s var(--ease); }
.gal__thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.gal__thumb::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--brass-2); transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--ease); }
.gal__thumb:hover { opacity: .75; }
.gal__thumb.is-on { opacity: 1; }
.gal__thumb.is-on::after { transform: scaleX(1); }
.gal__thumb:focus-visible { outline-offset: 1px; }

/* -- in and out ----------------------------------------------------------- */
.gal__top, .gal__foot { opacity: 0; transform: translateY(12px); transition: opacity .45s var(--ease), transform .7s var(--ease); }
.gal.is-open .gal__top, .gal.is-open .gal__foot { opacity: 1; transform: none; transition-delay: .12s; }
.gal__arrow { opacity: 0; }
.gal.is-open .gal__arrow { opacity: 1; transition-delay: .2s; }
.gal.is-open .gal__arrow[disabled] { opacity: .22; cursor: default; }
.gal.is-open .gal__arrow[disabled]:hover { background: rgba(18, 21, 31, .25); color: var(--paper); }
.gal.is-closing .gal__top, .gal.is-closing .gal__foot, .gal.is-closing .gal__arrow { opacity: 0; transition-delay: 0s; transition-duration: .3s; }
.gal.is-closing .gal__veil { opacity: 0; transition-duration: .4s; }
.gal.is-dragging .gal__frame { transition: none; }
.gal.is-jump .gal__slide.is-on .gal__frame { opacity: 0; transition-duration: .16s; }
.gal__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 860px) {
  .gal__top { grid-template-columns: minmax(0, 1fr) auto; padding: 14px var(--gut) 8px; gap: 12px; }
  .gal__title { font-size: 30px; margin-top: 6px; }
  .gal__awards { display: none; }
  .gal__close { height: 38px; padding: 0 15px; }
  .gal__close kbd { display: none; }
  .gal__slide { padding: 0; }
  .gal__frame { width: min(100cqw, 100cqh * var(--ar)); border-radius: 0; }
  .gal__room { font-size: 18px; }
  .gal__thumb { height: 46px; }
  .gal__foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}
@media (hover: none) {
  .gal__arrow, .gal__cursor { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gal *, .gal *::after, .gal__veil { transition-duration: .01s !important; transition-delay: 0s !important; }
}
