/* Gallery (prefix gl-). Shared tokens come from base.css.
   z-index: the photo viewer sits at 70 (header 50, menu 60, intro 100). */

.gl-photos [hidden], .gl-lb[hidden], .gl-lb [hidden] { display: none !important; }

/* ------------------------------------------------------------------ hero */
.gl-hero { padding-bottom: clamp(32px, 4vw, 56px); }
.gl-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px clamp(32px, 6vw, 112px); align-items: end; }
.gl-hero .h1 { font-size: clamp(2.75rem, 1.3rem + 5.2vw, 7rem); max-width: 14ch; }
.gl-counts { display: flex; gap: clamp(24px, 4vw, 64px); margin: 0; }
.gl-count { display: flex; flex-direction: column-reverse; gap: 8px; }
.gl-count dt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.gl-count dd { margin: 0; font-size: clamp(3.5rem, 1.6rem + 6vw, 8rem); font-weight: 900; font-stretch: 64%; line-height: 0.85; font-variant-numeric: tabular-nums; }
.gl-count:first-child dd { color: var(--accent-text); }
@media (max-width: 767px) { .gl-hero__grid { grid-template-columns: 1fr; } .gl-counts { justify-content: flex-start; } }

/* ------------------------------------------------------------------ photos: justified rows.
   Each photo's flex-grow and flex-basis follow its shape, so rows fill the width with no cropping gaps.
   Every photo shares one row height (--h): a taller height on some photos leaves empty bands in mixed rows. */
.gl-photos { padding-bottom: var(--section); }
.gl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-block: 24px; margin-bottom: clamp(20px, 3vw, 36px); border-top: 1px solid var(--line); }
.gl-bar__title { font-size: var(--step-3); font-weight: 860; font-stretch: 68%; text-transform: uppercase; line-height: 0.95; word-spacing: 0.14em; }
.gl-n { margin-left: 6px; font-family: var(--font-mono); font-size: 0.75rem; opacity: 0.62; }
@media (max-width: 767px) {
  .gl-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: calc(100% + var(--gutter) * 2); margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .gl-filters::-webkit-scrollbar { display: none; }
  .gl-filters .filter { flex: none; white-space: nowrap; }
}

.gl-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: clamp(6px, 0.8vw, 12px); }
.gl-grid::after { content: ""; flex-grow: 1000000; }
.gl-item { --h: clamp(130px, 17vw, 250px); flex: calc(var(--ar) * 100) 1 calc(var(--ar) * var(--h)); min-width: 0; }
.gl-item__btn { position: relative; display: block; width: 100%; aspect-ratio: var(--ar); overflow: hidden; border-radius: var(--radius); background: var(--bg-2); cursor: zoom-in; }
.gl-item__btn img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-out), filter 0.5s; }
.gl-item__btn:hover img, .gl-item__btn:focus-visible img { transform: scale(1.05); }
.gl-item__btn::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 0 var(--accent); transition: box-shadow 0.35s; pointer-events: none; }
.gl-item__btn:hover::after, .gl-item__btn:focus-visible::after { box-shadow: inset 0 0 0 3px var(--accent); }
.gl-none { padding-block: 48px; color: var(--ink-2); }
@media (max-width: 767px) {
  .gl-item { --h: 120px; }
}

/* ------------------------------------------------------------------ video */
.gl-reel { padding-block: var(--section); background: var(--bg-2); }
.gl-reel__head { display: grid; gap: 18px; margin-bottom: clamp(28px, 4vw, 56px); }
.gl-reel__head .h2 { max-width: 14ch; }
.gl-reel__grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(20px, 3vw, 48px); align-items: start; }
.gl-reel__frame { aspect-ratio: 16 / 9; background: #0d0e0c; }
.gl-reel__video { width: 100%; height: 100%; object-fit: contain; background: #0d0e0c; }
.gl-reel__caption { margin-top: 14px; color: var(--ink-2); font-size: var(--step--1); max-width: 62ch; min-height: 3em; }
.gl-reel__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 560px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.gl-clip { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px 14px 8px 8px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.3s, background 0.3s; }
.gl-clip:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.gl-clip.is-current { background: var(--ink); color: var(--bg); box-shadow: none; }
.gl-clip__thumb { aspect-ratio: 16 / 9; }
.gl-clip__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gl-clip__text { display: grid; gap: 4px; }
.gl-clip__title { font-weight: 700; font-stretch: 88%; }
.gl-clip__time { color: var(--muted); font-size: 0.75rem; }
.gl-clip.is-current .gl-clip__time { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.gl-clip__play { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); transition: background 0.3s, color 0.3s, box-shadow 0.3s; }
.gl-clip:hover .gl-clip__play { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.gl-clip.is-current .gl-clip__play { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
@media (max-width: 899px) {
  .gl-reel__grid { grid-template-columns: 1fr; }
  .gl-reel__list { display: flex; overflow-x: auto; overflow-y: hidden; max-height: none; scroll-snap-type: x proximity; padding-bottom: 8px; }
  .gl-reel__list li { flex: none; width: min(280px, 78vw); scroll-snap-align: start; }
  .gl-clip { grid-template-columns: 96px minmax(0, 1fr) auto; }
}

/* ------------------------------------------------------------------ follow */
.gl-follow__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px clamp(32px, 6vw, 112px); align-items: end; }
.gl-follow__grid .h2 { max-width: 10ch; margin-bottom: 18px; }
.gl-follow__list { list-style: none; margin: 0; padding: 0; display: grid; }
.gl-follow__link {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding-block: 20px;
  font-size: var(--step-3); font-weight: 820; font-stretch: 72%; text-transform: uppercase; line-height: 1;
  transition: padding 0.5s var(--ease-out), color 0.3s; word-spacing: 0.14em; }
.gl-follow__list li + li .gl-follow__link { border-top: 1px solid var(--line); }
.gl-follow__link .icon { width: 0.9em; height: 0.9em; }
.gl-follow__link:hover { padding-inline: 12px; color: var(--accent-text); }
@media (max-width: 767px) { .gl-follow__grid { grid-template-columns: 1fr; } .gl-follow__link:hover { padding-inline: 0; } }

/* ------------------------------------------------------------------ photo viewer */
.gl-lb {
  position: fixed; inset: 0; z-index: 70;
  display: grid; grid-template-rows: auto 1fr auto;
  background: rgb(10 11 9 / 0.95); color: var(--on-media);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.gl-lb.is-open { animation: gl-fade 0.35s var(--ease-out) both; }
@keyframes gl-fade { from { opacity: 0; } }
.gl-lb__top { display: flex; align-items: center; justify-content: space-between; padding: 14px var(--gutter); }
.gl-lb__count { color: rgb(244 244 240 / 0.78); }
.gl-lb__btn { color: var(--on-media); box-shadow: inset 0 0 0 1.5px rgb(244 244 240 / 0.45); }
.gl-lb__btn:hover { background: var(--on-media); color: #121311; box-shadow: none; }
.gl-lb__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 var(--gutter); touch-action: pan-y; }
.gl-lb__fig { margin: 0; display: grid; place-items: center; max-width: 100%; max-height: 100%; will-change: transform; }
.gl-lb__img { max-width: min(100%, 1500px); max-height: calc(100dvh - 190px); width: auto; height: auto; object-fit: contain; border-radius: var(--radius); -webkit-user-select: none; user-select: none; }
.gl-lb__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 52px; height: 52px; background: rgb(10 11 9 / 0.5); }
.gl-lb__nav--prev { left: var(--gutter); }
.gl-lb__nav--next { right: var(--gutter); }
.gl-lb__caption { padding: 16px var(--gutter) 24px; text-align: center; color: rgb(244 244 240 / 0.88); font-size: var(--step--1); max-width: 80ch; margin-inline: auto; min-height: 3.6em; }
@media (max-width: 767px) {
  .gl-lb__img { max-height: calc(100dvh - 220px); }
  .gl-lb__nav { top: auto; bottom: -64px; transform: none; }
  .gl-lb__nav--prev { left: calc(50% - 64px); }
  .gl-lb__nav--next { right: calc(50% - 64px); }
  .gl-lb__stage { margin-bottom: 72px; }
}

/* Phone held sideways: the photo gets the whole height. Close, counter, arrows and caption float over it. */
@media (max-height: 500px) and (orientation: landscape) {
  .gl-lb { grid-template-rows: 1fr; }
  .gl-lb__top { position: absolute; inset: 0 0 auto; z-index: 2; pointer-events: none; }
  .gl-lb__top .gl-lb__btn { pointer-events: auto; }
  .gl-lb__stage { margin: 0; grid-row: 1; }
  .gl-lb__img { max-height: calc(100dvh - 24px); }
  .gl-lb__caption { position: absolute; inset: auto 0 0; max-width: none; margin: 0; pointer-events: none; background: linear-gradient(transparent, rgb(10 11 9 / 0.8)); }
  .gl-lb__nav { top: 50%; bottom: auto; transform: translateY(-50%); }
  .gl-lb__nav--prev { left: var(--gutter); right: auto; }
  .gl-lb__nav--next { right: var(--gutter); left: auto; }
}
