/* BPH SYSTEMS — projects: cards, portfolio page, project page, photo slots and the photo viewer. */

/* ---------- project card ---------- */
.pjc {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  transition: transform 0.45s var(--ease), box-shadow 0.45s;
}
.pjc:hover { transform: translateY(-4px); box-shadow: 0 24px 60px rgba(17, 18, 20, 0.14); }
.pjc__img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--card-2); }
.pjc__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ease); }
.pjc:hover .pjc__img img { transform: scale(1.04); }
.pjc__badge {
  position: absolute;
  top: 14px; inset-inline-start: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111;
  background: rgba(255, 255, 255, 0.85);
}
.pjc__body { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px 24px; flex: 1; }
.pjc__tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.pjc h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
.pjc p { font-size: 15px; line-height: 1.55; color: var(--muted); }
.pjc__meta { margin-block-start: auto; padding-block-start: 8px; font-size: 13px; color: var(--faint); }

/* home: featured mosaic (one large, two stacked) */
.hsec__head--row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; max-width: none; }
.hsec__head--row .btn--dark { margin: 0; flex: none; }
.feat { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: auto auto; gap: 16px; }
.feat .pjc--big { grid-row: 1 / span 2; }
.feat .pjc--big .pjc__img { aspect-ratio: auto; flex: 1; min-height: 360px; }
.feat .pjc--big h3 { font-size: 30px; }
.feat .pjc:not(.pjc--big) { flex-direction: row; }
.feat .pjc:not(.pjc--big) .pjc__img { flex: 0 0 44%; aspect-ratio: auto; }
.feat .pjc:not(.pjc--big) .pjc__body p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feat .pjc:nth-child(2) { transition-delay: 0.08s; }
.feat .pjc:nth-child(3) { transition-delay: 0.16s; }

/* home: full-bleed photo band */
.photoband { position: relative; margin: 0; height: clamp(360px, 70vh, 640px); overflow: hidden; }
.photoband img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photoband::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 11, 13, 0.75), rgba(10, 11, 13, 0.05) 60%); }
.photoband__cap { position: absolute; inset-inline-start: var(--pad-x); bottom: clamp(36px, 8vh, 80px); z-index: 1; max-width: 640px; }
.photoband__cap .eyebrow { color: #f2b870; margin-block-end: 16px; }
.photoband__text { font-size: clamp(24px, 2.6vw, 40px); line-height: 1.2; font-weight: 300; letter-spacing: -0.02em; color: #fff; }

/* home: company photo */
.company__photo { margin: 0 0 28px; border-radius: 18px; overflow: hidden; position: relative; }
.company__photo img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.company__photo figcaption { position: absolute; inset-inline-start: 14px; bottom: 12px; font-size: 12.5px; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }

/* ---------- portfolio page ---------- */
.pj section, .pd section { padding: clamp(70px, 11vh, 130px) var(--pad-x); background: var(--bg); }
.pj section.hsec--alt, .pd section.hsec--alt { background: var(--bg-alt, #0a0d12); }
.pj .pj-intro { padding-block-start: clamp(140px, 20vh, 220px); padding-block-end: 30px; }
.pj-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 36px; }
.pj .pj-list { padding-block-start: 30px; }
.pj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.pj-grid .pjc { animation: dlIn 0.5s var(--ease) both; }
.pj-grid .pjc:nth-child(3n+1) { grid-column: 1 / -1; }
.pj-grid .pjc:nth-child(3n+1) { flex-direction: row; }
.pj-grid .pjc:nth-child(3n+1) .pjc__img { flex: 0 0 62%; aspect-ratio: 16 / 9; }
.pj-grid .pjc:nth-child(3n+1) .pjc__body { padding: 36px; justify-content: center; }
.pj-grid .pjc:nth-child(3n+1) h3 { font-size: 32px; }
.pj-sample { margin-block-start: 30px; }

/* ---------- project page ---------- */
:is(.pd, .ar) .pd-hero { position: relative; padding: 0; height: min(92vh, 860px); min-height: 520px; overflow: hidden; color: #fff; }
.pd-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: heroZoom 14s ease-out both; }
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.pd-hero__shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 11, 13, 0.85) 0%, rgba(10, 11, 13, 0.25) 55%, rgba(10, 11, 13, 0.35) 100%); }
.pd-hero__text { position: absolute; inset-inline: var(--pad-x); bottom: clamp(40px, 9vh, 90px); max-width: 900px; }
.pd-crumbs { display: flex; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, 0.7); margin-block-end: 18px; }
.pd-crumbs a { color: #fff; text-decoration: none; border-block-end: 1px solid rgba(255, 255, 255, 0.4); }
.pd-hero h1 { font-size: clamp(44px, 6vw, 100px); line-height: 1; letter-spacing: -0.035em; font-weight: 600; }
.pd-hero p { margin-block-start: 22px; max-width: 52ch; font-size: clamp(16px, 1.3vw, 20px); line-height: 1.55; color: rgba(255, 255, 255, 0.85); }
.pd-hero__meta { display: block; margin-block-start: 18px; font-size: 13.5px; color: rgba(255, 255, 255, 0.65); }
.pd-hero__meta b { color: #f2b870; font-weight: 500; }

.pd .pd-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-block: 0; border-block-end: 1px solid var(--line); }
.pd-facts div { display: flex; flex-direction: column; gap: 4px; padding: 30px 0; border-inline-start: 1px solid var(--line); padding-inline-start: 24px; }
.pd-facts div:first-child { border-inline-start: 0; padding-inline-start: 0; }
.pd-facts b { font-size: clamp(28px, 3vw, 46px); font-weight: 300; letter-spacing: -0.03em; }
.pd-facts span { font-size: 13.5px; color: var(--muted); }

.pd-sec__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-block-end: 28px; }
.pd-all { background: none; border: 0; border-block-end: 1px solid var(--line); cursor: pointer; font: inherit; font-size: 14.5px; }

.pd-mosaic { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(140px, 16vw, 230px); gap: 10px; }
.pd-tile { position: relative; padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: zoom-in; background: var(--card-2); }
.pd-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.9s var(--ease), filter 0.4s; }
.pd-tile:hover img { transform: scale(1.05); }
.pd-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pd-tile--big { grid-column: span 2; grid-row: span 2; }
.pd-more { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 300; color: #fff; background: rgba(10, 11, 13, 0.55); }

.pd-video__wrap { max-width: 1200px; margin-inline: auto; }
.pd-video__wrap header { margin-block-end: 24px; }
.pd-video__frame { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #0e1013; box-shadow: 0 30px 80px rgba(17, 18, 20, 0.2); }
.pd-video__el { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.pd-video__ph { position: absolute; inset: 0; display: grid; place-items: center; background-size: cover; background-position: center; }
.pd-video__ph::before { content: ""; position: absolute; inset: 0; background: rgba(10, 11, 13, 0.45); }
.pd-video__play { position: relative; width: 84px; height: 84px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); }
.pd-video__play::after { content: ""; position: absolute; left: 34px; top: 26px; border-style: solid; border-width: 16px 0 16px 26px; border-color: transparent transparent transparent #111; }
.pd-video__soon { position: absolute; bottom: 22px; font-size: 14px; color: #fff; }

.pd .pd-story { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 60px); }
.pd-k { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.pd-story h3 { margin-block: 12px 14px; font-size: 24px; font-weight: 600; letter-spacing: -0.015em; }
.pd-story p, .pd-story li { font-size: 16px; line-height: 1.65; color: var(--muted); }
.pd-story ul { list-style: none; display: grid; gap: 10px; }
.pd-story li { position: relative; padding-inline-start: 18px; }
.pd-story li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.65em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.pd .pd-tech { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 60px); }
.pd-tech__title { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.26em; text-transform: uppercase; color: var(--faint); margin-block-end: 18px; }
.pd-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.pd-chips li { padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.pd-chips--links li { padding: 0; }
.pd-chips--links a { display: inline-flex; gap: 8px; align-items: baseline; padding: 8px 14px; color: var(--fg); text-decoration: none; }
.pd-chips--links small { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.pd-chips--links a:hover { color: var(--accent); }

.pd-docs .sec-title { margin-block-end: 24px; }
.pd .pd-next { display: grid; gap: 20px; }
.pd .pd-next .eyebrow { margin: 0; }
.pjc--wide { flex-direction: row; max-width: 1000px; }
.pjc--wide .pjc__img { flex: 0 0 46%; aspect-ratio: 16 / 10; }
.pd-noscript { padding: 160px var(--pad-x); }

/* ---------- photo viewer ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  align-items: center;
  background: rgba(8, 9, 11, 0.94);
  opacity: 0;
  transition: opacity 0.25s ease;
  touch-action: pan-y;
}
.lb.is-open { opacity: 1; }
.lb__fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.lb__img { max-width: 100%; max-height: 82vh; border-radius: 8px; opacity: 0; transform: scale(0.985); transition: opacity 0.35s ease, transform 0.35s ease; }
.lb__img.is-in { opacity: 1; transform: none; }
.lb__cap { display: flex; gap: 18px; font-size: 14px; color: rgba(255, 255, 255, 0.8); }
.lb__count { font-family: var(--mono); color: rgba(255, 255, 255, 0.5); }
.lb__nav, .lb__close {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s;
}
.lb__nav { justify-self: center; width: 52px; height: 52px; font-size: 30px; line-height: 1; }
.lb__nav:hover, .lb__close:hover { background: rgba(255, 255, 255, 0.18); }
.lb__nav[hidden] { visibility: hidden; display: block; }
.lb__close { position: absolute; top: 18px; inset-inline-end: 18px; width: 46px; height: 46px; font-size: 28px; line-height: 1; }
.lb button:focus-visible { outline: 2px solid #f2b870; outline-offset: 2px; }

/* ---------- small screens ---------- */
@media (max-width: 1000px) {
  .feat { grid-template-columns: minmax(0, 1fr); }
  .feat .pjc--big { grid-row: auto; }
  .feat .pjc--big .pjc__img { min-height: 260px; }
  .pj-grid { grid-template-columns: minmax(0, 1fr); }
  .pj-grid .pjc:nth-child(3n+1) { flex-direction: column; }
  .pj-grid .pjc:nth-child(3n+1) .pjc__img { flex: none; }
  .pj-grid .pjc:nth-child(3n+1) .pjc__body { padding: 22px 24px 24px; }
  .pd .pd-story, .pd .pd-tech { grid-template-columns: minmax(0, 1fr); }
  .pd .pd-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-facts div:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .pjc--wide { flex-direction: column; }
}
@media (max-width: 640px) {
  .hsec__head--row { flex-direction: column; align-items: flex-start; }
  .feat .pjc:not(.pjc--big) { flex-direction: column; }
  .pd-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 140px; }
  .lb { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .lb__nav { display: none; }
  .lb__img { max-height: 70vh; }
}

/* header over a dark cover photo (project page): white text until the page scrolls */
.has-photo-hero .site-header:not(.is-scrolled) { --fg: #fff; --muted: rgba(255, 255, 255, 0.78); --faint: rgba(255, 255, 255, 0.5); }
.has-photo-hero .site-header:not(.is-scrolled) .btn--ghost { border-color: rgba(255, 255, 255, 0.45); }
.has-photo-hero .site-header:not(.is-scrolled) .burger span { background: #fff; }
