@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=JetBrains+Mono:wght@300;400;500;600&display=swap");

:root {
  --display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --mono: "JetBrains Mono", monospace;
  --bg: #ffffff;
  --fg: #0a0a0a;
  --dim: #6b6b6b;
  --dim2: #a3a3a3;
  --line: rgba(0, 0, 0, 0.08);
  --rule: rgba(0, 0, 0, 0.16);
  --accent: #003314;
  --accent-tint: rgba(0, 51, 20, 0.06);
  --nav-h: 56px;
  --expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* , *:before, *:after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; }

/* ---------- Nav ---------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 210;
  background: hsla(0, 0%, 100%, .85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  transition: transform .45s var(--expo);
}
nav.out { transform: translateY(-100%); }
nav.menu-open { transform: translateY(0); background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom-color: transparent; }

.logo-group { display: flex; align-items: center; gap: 10px; z-index: 210; }
.logo {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: letter-spacing .4s var(--expo);
}
.logo:hover { letter-spacing: .08em; color: var(--fg); }
.logo-ig { display: flex; align-items: center; opacity: .85; transition: opacity .2s ease; }
.logo-ig:hover { opacity: 1; }
.logo-ig img { width: 15px; height: 15px; display: block; }

.links { display: flex; gap: 28px; }
.links a {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  position: relative;
}
.links a:after {
  content: "";
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s var(--expo);
}
.links a:hover { color: var(--fg); }
.links a:hover:after { transform: scaleX(1); transform-origin: left; }
.links a.active { color: var(--fg); }
.links a.active:after { transform: scaleX(1); background: var(--accent); }

.hamburger { display: none; background: none; border: none; cursor: pointer; width: 28px; height: 20px; position: relative; z-index: 210; padding: 0; }
.hamburger span { display: block; position: absolute; left: 0; width: 100%; height: 1.5px; background: var(--fg); transition: transform .35s var(--expo), opacity .25s ease; }
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger span:nth-child(3) { bottom: 0; }
.hamburger.open span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { bottom: auto; top: 50%; transform: translateY(-50%) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed; inset: 0; z-index: 205;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--expo);
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu a {
  font-family: var(--display);
  font-size: 44px;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--fg);
  line-height: 1.5;
}
.mobile-menu a:hover { color: var(--accent); }
.mobile-menu-contact {
  position: absolute;
  bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.mobile-menu-contact a { font-family: var(--mono); font-size: 10px; letter-spacing: .02em; color: var(--dim); }
.mobile-menu-contact a:hover { color: var(--accent); }

.clock-corner {
  position: fixed;
  bottom: 20px; right: 24px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--dim2);
  z-index: 50;
  transition: opacity .25s ease;
}

@media (max-width: 768px) {
  nav { padding: 0 18px; }
  .links { display: none; }
  .hamburger { display: block; }
  .mobile-menu { display: flex; }
  .clock-corner { display: none; }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--expo), transform .7s var(--expo);
}
.reveal.vis { opacity: 1; transform: translateY(0); }

/* ---------- Hero video (josephkhale.com hero-video style) ---------- */
.hero-video {
  margin-top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  min-height: 420px;
  overflow: hidden;
  background: var(--bg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.hero-video video {
  max-height: 51vh;
  width: auto;
  max-width: 44%;
  display: block;
  background: var(--bg);
}

.scroll-hint {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  transition: opacity .5s ease;
}
.scroll-hint.hidden { opacity: 0; pointer-events: none; }
.scroll-hint-line {
  display: block; width: 1px; height: 32px;
  background: var(--dim2);
  position: relative;
  animation: scrollPulse 2s ease-in-out infinite;
}
.scroll-hint-line:after {
  content: ""; position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 6px; height: 6px;
  border-right: 1px solid var(--dim2);
  border-bottom: 1px solid var(--dim2);
}
@keyframes scrollPulse { 0%, 100% { opacity: .4; transform: translateY(0); } 50% { opacity: 1; transform: translateY(6px); } }

@media (max-width: 1024px) {
  .hero-video video { max-height: 46vh; width: auto; max-width: 66%; }
}
@media (max-width: 768px) {
  .hero-video video { max-height: none; width: 77%; max-width: 77%; height: 44vh; object-fit: cover; }
}

/* ---------- Section headers ---------- */
.section-head {
  padding: 56px 28px 28px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.section-head h2 {
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.section-head .section-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim2);
  letter-spacing: .08em;
}

/* ---------- Project grid (Featured Work / Featured Selects) ---------- */
.proj-grid {
  padding: 0 28px 40px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  row-gap: 36px;
}
.proj-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.proj-card-0 { grid-column: 1 / 7; }
.proj-card-1 { grid-column: 7 / 13; }
.proj-card-2 { grid-column: 1 / 5; }
.proj-card-3 { grid-column: 5 / 9; }
.proj-card-4 { grid-column: 9 / 13; }

.proj-card-img { position: relative; width: 100%; overflow: hidden; background: #f2f2f2; }
.proj-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--expo); }
.proj-card:hover .proj-card-img img { transform: scale(1.035); }

.proj-card-info { padding: 12px 0 0; display: flex; align-items: baseline; gap: 12px; }
.proj-card-num { font-family: var(--mono); font-size: 10px; color: var(--accent); letter-spacing: .04em; }
.proj-card-title { font-family: var(--display); font-size: clamp(18px, 2.2vw, 30px); font-weight: 400; text-transform: uppercase; line-height: 1.1; }
.proj-card-cat { font-family: var(--mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin-left: auto; }

.view-all { padding: 40px 0 20px; text-align: center; }
.view-all a { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); transition: color .25s ease, letter-spacing .4s var(--expo); }
.view-all a:hover { color: var(--fg); letter-spacing: .18em; }

@media (max-width: 768px) {
  .proj-grid { grid-template-columns: 1fr 1fr; gap: 14px; row-gap: 28px; padding: 0 18px 32px; }
  .proj-card-0, .proj-card-1 { grid-column: 1 / -1; }
  .proj-card-2, .proj-card-3, .proj-card-4 { grid-column: span 1; }
  .proj-card-cat { display: none; }
  .section-head { padding: 40px 18px 20px; }
}

/* ---------- Featured Selects page (full grid) ---------- */
.page-hero { margin-top: var(--nav-h); padding: 64px 28px 8px; }
.page-hero h1 { font-family: var(--display); font-size: clamp(40px, 8vw, 76px); text-transform: uppercase; line-height: .95; }
.page-hero p { font-family: var(--mono); font-size: 11px; color: var(--dim); max-width: 480px; margin-top: 14px; line-height: 1.7; }

/* ---------- Featured Selects index list (josephkhale.com/idx style) ---------- */
.idx-page { margin-top: var(--nav-h); padding: 32px 28px 80px; min-height: calc(100vh - var(--nav-h)); }
.idx-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.idx-title { font-family: var(--display); font-size: clamp(36px, 5vw, 56px); font-weight: 400; letter-spacing: .01em; line-height: 1; text-transform: uppercase; }
.idx-count { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }

.idx-filters { display: flex; gap: 6px; margin-bottom: 24px; padding-bottom: 20px; flex-wrap: wrap; }
.idx-filter {
  font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim2); background: none; border: 1px solid var(--line); padding: 6px 14px; cursor: pointer;
  transition: color .25s ease, border-color .25s ease;
}
.idx-filter:hover { color: var(--fg); border-color: var(--dim); }
.idx-filter.active { color: var(--fg); border-color: var(--accent); }

.idx-table { width: 100%; }
.idx-table-head, .idx-row {
  display: grid;
  grid-template-columns: 48px 1fr 120px 140px 100px 160px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.idx-table-head { padding: 8px 0; font-size: 8px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim2); }
.idx-row { padding: 18px 0; text-decoration: none; color: inherit; transition: padding-left .35s var(--expo); }
.idx-row:hover { padding-left: 10px; }
.idx-col-num { font-size: 10px; color: var(--accent); letter-spacing: .04em; align-self: center; }
.idx-col-name { font-family: var(--display); font-size: clamp(18px, 3vw, 28px); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: 1.1; transition: opacity .25s; align-self: center; }
.idx-col-cat, .idx-col-client, .idx-col-date, .idx-col-loc { font-size: 9px; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); align-self: center; transition: opacity .25s; }
.idx-table:hover .idx-row:not(:hover) .idx-col-name { opacity: .15; }
.idx-table:hover .idx-row:not(:hover) .idx-col-cat,
.idx-table:hover .idx-row:not(:hover) .idx-col-client,
.idx-table:hover .idx-row:not(:hover) .idx-col-date,
.idx-table:hover .idx-row:not(:hover) .idx-col-loc,
.idx-table:hover .idx-row:not(:hover) .idx-col-num { opacity: .1; }

.idx-mobile-preview { display: none; }
.idx-preview {
  position: fixed; width: 300px; pointer-events: none; z-index: 150;
  opacity: 0; transform: scale(.9) rotate(-1deg);
  transition: opacity .3s var(--expo), transform .35s var(--expo);
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.idx-preview img { width: 100%; display: block; aspect-ratio: 4/5; object-fit: cover; }
.idx-preview.show { opacity: 1; transform: scale(1) rotate(0deg); }

@media (max-width: 900px) {
  .idx-page { padding: 24px 18px 60px; }
  .idx-table-head { display: none; }
  .idx-row { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
  .idx-col-num { order: 2; }
  .idx-col-name { order: 1; flex: 1 0 100%; font-size: 22px; }
  .idx-col-client, .idx-col-loc { display: none; }
  .idx-mobile-preview { display: block; order: 10; flex: 1 0 100%; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .4s var(--expo), opacity .3s ease, margin .4s var(--expo); margin: 0; }
  .idx-mobile-preview.show { max-height: 600px; opacity: 1; margin: 12px 0 4px; }
  .idx-mobile-preview img { width: 100%; display: block; }
  .idx-mobile-cta { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-top: 8px; }
  .idx-row-expanded { padding-bottom: 18px; }
  .idx-row-expanded .idx-col-name { opacity: 1 !important; }
}

/* ---------- BTS ---------- */
.bts-grid {
  padding: 40px 28px 60px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-flow: dense;
  gap: 24px;
  align-items: center;
}
.bts-slot {
  aspect-ratio: 4 / 5;
  border: 1px dashed var(--dim2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--dim2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  transition: border-color .3s ease, color .3s ease;
}
.bts-slot:hover { border-color: var(--accent); color: var(--accent); }
.bts-slot .plus { font-family: var(--display); font-size: 28px; line-height: 1; color: inherit; }
.bts-item { overflow: hidden; cursor: pointer; }
.bts-item img { width: 100%; height: auto; display: block; }
.bts-item-wide { grid-column: span 2; }

/* Lifestyle Customs grid: real masonry, positioned in JS (script.js). Column count
   and item x/y/width are computed from each photo's actual rendered aspect
   ratio, so wide photos scale up at full size — never cropped — and every
   column height is tracked precisely, so there are never blank voids. */
.lifestyle-grid {
  position: relative;
  padding: 40px 28px 60px;
}
.lifestyle-grid .bts-item { position: absolute; top: 0; left: 0; }

@media (max-width: 1100px) {
  .bts-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
@media (max-width: 900px) {
  .bts-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .bts-slot { aspect-ratio: 4 / 5; }
}
@media (max-width: 480px) {
  .bts-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* ---------- BTS lightbox ---------- */
.bts-lb { position: fixed; inset: 0; z-index: 500; background: #fff; }
.bts-lb-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 510;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px;
}
.bts-lb-counter { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--dim); }
.bts-lb-close {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); background: none; border: none; cursor: pointer; transition: color .2s ease;
}
.bts-lb-close:hover { color: var(--fg); }
.bts-lb-scroll {
  height: 100vh; overflow-y: auto; scroll-snap-type: y proximity;
  -webkit-overflow-scrolling: touch; padding: 60px 0;
}
.bts-lb-item {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 40px 80px; scroll-snap-align: start;
}
.bts-lb-item img { max-width: 100%; max-height: 90vh; width: auto; height: auto; object-fit: contain; }

@media (max-width: 768px) {
  .bts-lb-item { padding: 20px 16px; }
}

/* ---------- Info page ---------- */
.info-page {
  margin-top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-columns: 320px 1fr;
}
.info-left {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}
.info-portrait-slot {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4 / 5;
  border: 1px dashed var(--dim2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--dim2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  padding: 16px;
}
.info-portrait-slot .plus { font-family: var(--display); font-size: 28px; line-height: 1; }
.info-portrait { width: 100%; max-width: 280px; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.info-left-contact { display: flex; flex-direction: column; gap: 6px; }
.info-left-contact a { font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: .02em; }
.info-left-contact a.contact-primary { font-size: 12px; color: var(--fg); }
.info-left-contact a:hover { color: var(--accent); }

.info-right {
  padding: 32px 40px 40px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.info-bio-text {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2;
  color: var(--fg);
  letter-spacing: .01em;
  max-width: 560px;
}
.info-bio-text + .info-bio-text { margin-top: 20px; }
.info-hr { width: 32px; height: 1px; background: var(--line); margin: 24px 0; }
.info-right-contact { display: flex; gap: 24px; margin-top: 36px; }
.info-right-contact a { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.info-right-contact a:hover { color: var(--accent); }
.info-section { margin-top: 40px; padding: 16px 0; border-top: 1px solid var(--rule); max-width: 560px; }
.info-col-label { font-family: var(--display); font-size: 18px; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; color: var(--fg); margin-bottom: 8px; }
.info-col-body { font-family: var(--mono); font-size: 10px; line-height: 1.7; color: var(--dim); letter-spacing: .02em; }
.info-col-body a { color: var(--dim); transition: color .2s ease; }
.info-col-body a:hover { color: var(--accent); }

@media (max-width: 900px) {
  .info-page { grid-template-columns: 1fr; }
  .info-left { flex-direction: column; }
  .info-portrait-slot { max-width: 100%; }
  .info-right { padding: 40px 18px; border-left: none; border-top: 1px solid var(--line); }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
}
.foot-l { font-size: 9px; color: var(--dim); letter-spacing: .04em; }
.foot-r { display: flex; gap: 20px; }
.foot-r a { font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.foot-r a:hover { color: var(--accent); }

@media (max-width: 768px) {
  .site-footer { padding: 20px 18px; flex-direction: column; gap: 10px; text-align: center; }
}

/* ---------- Project detail page (josephkhale.com/projects/[slug] style) ---------- */
body:has(.proj-head) .clock-corner { display: none; }

.proj-head {
  margin-top: var(--nav-h);
  padding: 6px 32px 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.proj-title { font-family: var(--display); font-size: clamp(36px, 6vw, 72px); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: .95; }
.proj-meta { display: flex; gap: 24px; align-items: baseline; flex-shrink: 0; }
.proj-meta span { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.proj-meta span + span:before { content: "·"; margin-right: 24px; color: var(--dim2); }

.proj-context { padding: 4px 32px 32px; max-width: 640px; }
.proj-context p { font-family: var(--mono); font-size: 13px; line-height: 1.8; color: var(--fg); letter-spacing: .01em; }
.proj-context p + p { margin-top: 16px; }

.gallery { padding: 0 23vw; display: flex; flex-direction: column; }
.g-row { display: flex; align-items: center; gap: 40px; justify-content: center; padding: 40px 0; width: 100%; }

/* Empty placeholder slots (projects with no photos uploaded yet) */
.g-slot {
  overflow: hidden;
  border: 1px dashed var(--dim2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--dim2);
  font-family: var(--mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; text-align: center;
  padding: 16px;
  transition: opacity .7s var(--expo), transform .7s var(--expo), border-color .3s ease, color .3s ease;
  opacity: 0; transform: translateY(20px);
}
.g-slot.vis { opacity: 1; transform: translateY(0); }
.g-slot:hover { border-color: var(--accent); color: var(--accent); }
.g-slot .plus { font-family: var(--display); font-size: 28px; line-height: 1; }
.g-full .g-slot { flex: 0 0 100%; aspect-ratio: 16 / 9; }
.g-diptych { gap: 16px; }
.g-diptych .g-slot { flex: 0 0 auto; max-width: 40%; width: 40%; aspect-ratio: 4 / 5; }
.g-trio .g-slot { flex: 1 1; aspect-ratio: 4 / 5; }
.g-centered .g-slot { flex: 0 0 auto; max-width: 65%; width: 65%; aspect-ratio: 4 / 5; }
.g-centered.g-centered-sm .g-slot { max-width: 45%; width: 45%; }
.g-centered.g-centered-lg .g-slot { max-width: 90%; width: 90%; }
.g-cinematic .g-slot { flex: 0 0 100%; aspect-ratio: 21 / 9; }

/* Real photos: each image keeps its own natural aspect ratio, never cropped */
.g-img {
  overflow: hidden;
  opacity: 0; transform: translateY(20px);
  transition: opacity .7s var(--expo), transform .7s var(--expo);
}
.g-img.vis { opacity: 1; transform: translateY(0); }
.g-img img { width: 100%; height: auto; display: block; }

.g-full .g-img { flex: 0 0 100%; }
.g-cinematic { margin: 0 -23vw; width: calc(100% + 46vw); }
.g-cinematic .g-img { flex: 0 0 100%; }
.g-cinematic .g-img img { width: 100%; height: auto; }

/* Almost full-bleed: wider than the column, but leaves a small margin from the viewport edge */
.g-cinematic-wide { margin: 0 -19vw; width: calc(100% + 38vw); }
.g-cinematic-wide .g-img { flex: 0 0 100%; }
.g-cinematic-wide .g-img img { width: 100%; height: auto; }
.g-cinematic-wide.g-pair .g-img { flex: 1 1; }
.g-cinematic-wide.g-trio .g-img { flex: 1 1; }

.g-centered .g-img { flex: 0 0 auto; max-width: 65%; }
.g-centered.g-centered-sm .g-img { max-width: 45%; }
.g-centered.g-centered-lg .g-img { max-width: 90%; }
.g-centered.g-centered-half .g-img { max-width: calc(50% - 20px); }
.g-centered.g-centered-35 .g-img { max-width: 35%; }
.g-centered.g-centered-60 .g-img { max-width: 60%; }
.g-centered.g-centered-80 .g-img { max-width: 80%; }
.g-centered.g-centered-85 .g-img { max-width: 85%; }
.g-centered .g-img img { max-height: 85vh; width: auto; object-fit: contain; }
.g-centered.g-centered-sm .g-img img { max-height: 70vh; }

.g-pair .g-img { flex: 1 1; }

/* Matched-height pair: both images fill the row's fixed width, each getting a share
   proportional to its own aspect ratio (set inline per-image) — since width-per-ratio
   is constant, the resulting heights come out equal without either photo overflowing. */
.g-pair-matched .g-img { flex: 1 1 0; }

.g-pair-wide .g-img:first-child { flex: 0 0 62%; }
.g-pair-wide .g-img:last-child { flex: 1 1; }
.g-pair-narrow .g-img:first-child { flex: 1 1; }
.g-pair-narrow .g-img:last-child { flex: 0 0 62%; }
.g-trio .g-img { flex: 1 1; }
.g-trio.g-trio-sm { max-width: 82%; margin: 0 auto; }

.proj-banner {
  position: fixed; bottom: 0; left: 0; right: 0; height: 34px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: hsla(0, 0%, 100%, .9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  z-index: 150;
  transform: translateY(100%);
  transition: transform .45s var(--expo);
}
.proj-banner.show { transform: translateY(0); }
.proj-banner-title { font-family: var(--display); font-size: 15px; text-transform: uppercase; letter-spacing: .02em; }
.proj-banner-meta { display: flex; gap: 20px; }
.proj-banner-meta span { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.proj-banner-meta span + span:before { content: "·"; margin-right: 20px; color: var(--dim2); }

@media (max-width: 768px) {
  .proj-head { flex-direction: column; gap: 8px; padding: 12px 16px 14px; }
  .proj-title { font-size: clamp(32px, 9vw, 48px); }
  .proj-meta { gap: 8px 16px; flex-wrap: wrap; }
  .proj-meta span { font-size: 8px; }
  .proj-meta span + span:before { margin-right: 16px; }
  .gallery { padding: 12px 0 0; }
  .proj-context { padding: 4px 16px 24px; }
  .g-row { flex-direction: column; gap: 20px; padding: 24px 0; }
  .g-full .g-slot, .g-diptych .g-slot, .g-trio .g-slot, .g-centered .g-slot,
  .g-centered.g-centered-sm .g-slot, .g-centered.g-centered-lg .g-slot,
  .g-full .g-img, .g-pair .g-img, .g-pair-wide .g-img, .g-pair-narrow .g-img,
  .g-trio .g-img, .g-centered .g-img, .g-centered.g-centered-sm .g-img, .g-centered.g-centered-lg .g-img, .g-centered.g-centered-half .g-img, .g-centered.g-centered-35 .g-img, .g-centered.g-centered-60 .g-img, .g-centered.g-centered-80 .g-img, .g-centered.g-centered-85 .g-img {
    flex: 0 0 100%; max-width: 100%; width: 100%;
  }
  .g-centered .g-img img { max-height: none; width: 100%; height: auto; object-fit: initial; }
  .g-cinematic, .g-cinematic-wide { margin: 0; width: 100%; }
  .g-trio.g-trio-sm { max-width: 100%; }
  .proj-banner { height: auto; min-height: 34px; flex-wrap: wrap; gap: 4px; padding: 6px 16px; }
  .proj-banner-title { font-size: 12px; }
  .proj-banner-meta { gap: 12px; flex-wrap: wrap; }
  .proj-banner-meta span { font-size: 8px; }
  .proj-banner-meta span + span:before { margin-right: 12px; }
}
