/* project case study. Loaded after main.css and /assets/site/projects.css (which owns
   the --px-* tokens, .px-eyebrow, .px-crumb and the .px-card used for related projects).
   Every class here is prefixed pd-. */

/* ---------- Hero: photo first, title low on a gradient ---------- */
.pd-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(82vh, 720px); display: flex; align-items: flex-end;
  background: var(--black); color: #fff;
}
.pd-hero__bg {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.06); animation: px-settle 2.4s var(--px-ease) forwards;
}
.pd-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,.05) 30%, rgba(0,0,0,.2) 55%, rgba(0,0,0,.85) 100%),
    linear-gradient(90deg, rgba(66,5,0,.45) 0%, rgba(0,0,0,0) 55%);
}
.pd-hero__inner { padding-block: clamp(96px, 14vh, 160px) clamp(40px, 6vw, 72px); }
.pd-hero .px-crumb li:last-child { max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-hero__title {
  font-size: clamp(2.2rem, 1.1rem + 4.6vw, 4.75rem); font-weight: 800; line-height: 1.02;
  letter-spacing: -.02em; max-width: 18ch;
}
.pd-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 22px 0 0; font-size: .9375rem; font-weight: 600; color: rgba(255,255,255,.88); }
.pd-hero__meta span { display: inline-flex; align-items: center; gap: 8px; }
.pd-hero__meta svg { width: 18px; height: 18px; }
.pd-hero__state { padding: 6px 12px; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.pd-hero__state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; }
.pd-hero.is-ongoing .pd-hero__state::before { background: #f59e0b; animation: px-pulse 2s infinite; }

/* ---------- Key facts band ---------- */
.pd-facts { background: var(--charcoal); color: #fff; }
.pd-facts__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 0; }
.pd-facts__grid > div { position: relative; padding: 28px 24px 30px; border-left: 1px solid var(--rule-dark); }
.pd-facts__grid > div:first-child { border-left: 0; padding-left: 0; }
.pd-facts dt { font-size: .6875rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.62); }
.pd-facts dd { margin: 8px 0 0; font-size: clamp(1rem, .9rem + .4vw, 1.2rem); font-weight: 700; line-height: 1.3; }
.pd-facts dd small { display: block; margin-top: 4px; font-size: .8125rem; font-weight: 500; color: rgba(255,255,255,.72); }
.pd-progress { display: block; height: 4px; margin-top: 12px; max-width: 200px; background: rgba(255,255,255,.18); border-radius: 2px; overflow: hidden; }
.pd-progress i { display: block; height: 100%; background: #f59e0b; }

/* ---------- Overview: scope as a statement + sticky aside ---------- */
.pd-overview { padding-block: var(--section-y); }
.pd-overview__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(40px, 6vw, 96px); align-items: start; }
.pd-label { margin: 0 0 20px; color: var(--oxblood); }
.pd-statement {
  margin: 0; font-size: clamp(1.5rem, 1rem + 1.9vw, 2.5rem); font-weight: 700; line-height: 1.22;
  letter-spacing: -.01em; color: var(--black); max-width: 26ch;
}
.pd-summary { margin: 28px 0 0; max-width: 64ch; font-size: 1.0625rem; }
.pd-summary + .pd-summary { margin-top: 16px; }
.pd-highlights { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 32px; }
.pd-highlights li { padding: 14px 0 0 0; border-top: 2px solid var(--oxblood); font-weight: 600; }

.pd-aside { position: sticky; top: calc(var(--header-h) + 24px); padding: 28px; background: var(--mist); border-radius: var(--px-radius); }
.pd-aside__label { margin: 0 0 12px; font-size: .6875rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--steel); }
.pd-aside__label + .pd-aside__text { margin-top: -4px; }
.pd-logos { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0 0 28px; }
.pd-logos li { display: flex; align-items: center; justify-content: center; width: 120px; height: 64px; padding: 10px; background: #fff; border-radius: var(--px-radius); }
.pd-logos img { width: auto; height: auto; max-width: 100%; max-height: 100%; }
.pd-aside__text { font-size: .9375rem; color: var(--charcoal); }
.pd-aside__btn { width: 100%; justify-content: center; }
.pd-aside__dl { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: .875rem; font-weight: 600; color: var(--oxblood); text-decoration: none; }
.pd-aside__dl:hover { text-decoration: underline; }
.pd-aside__dl svg { width: 18px; height: 18px; }

/* ---------- Gallery mosaic ---------- */
.pd-gallery { padding-bottom: var(--section-y); }
.pd-mosaic {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 17vw, 250px);
  gap: clamp(8px, 1vw, 14px); grid-auto-flow: dense;
}
.pd-mosaic > li:first-child { grid-column: span 2; grid-row: span 2; }
.pd-mosaic--2 > li { grid-column: span 2; grid-row: span 2; }
.pd-mosaic--3 > li:not(:first-child) { grid-column: span 2; }
.pd-mosaic--4 > li:nth-child(2) { grid-column: span 2; }
.pd-mosaic > li.is-wide { grid-column: span 2; } /* set by the page to fill the last row */
.pd-tile {
  position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; overflow: hidden;
  border-radius: var(--px-radius); background: var(--mist); cursor: zoom-in;
}
.pd-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--px-ease); }
.pd-tile::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0); transition: background .4s; }
.pd-tile__icon {
  position: absolute; right: 14px; bottom: 14px; z-index: 1; width: 40px; height: 40px; padding: 9px;
  border-radius: 50%; background: rgba(255,255,255,.92); color: var(--charcoal);
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s var(--px-ease);
}
.pd-tile:hover img, .pd-tile:focus-visible img { transform: scale(1.05); }
.pd-tile:hover::after { background: rgba(0,0,0,.18); }
.pd-tile:hover .pd-tile__icon, .pd-tile:focus-visible .pd-tile__icon { opacity: 1; transform: none; }
.pd-tile:focus-visible { outline: 3px solid var(--oxblood); outline-offset: 3px; }

/* ---------- Next project: full-width photo link ---------- */
.pd-next { position: relative; isolation: isolate; display: block; overflow: hidden; background: var(--black); color: #fff; text-decoration: none; }
.pd-next img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: transform 1.2s var(--px-ease), opacity .6s; }
.pd-next::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(66,5,0,.75) 0%, rgba(0,0,0,.2) 70%); }
.pd-next__inner { position: relative; display: block; padding-block: clamp(64px, 9vw, 120px); }
.pd-next .px-eyebrow { display: block; margin: 0 0 14px; }
.pd-next__name { display: block; max-width: 20ch; font-size: clamp(1.9rem, 1rem + 3.4vw, 3.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.pd-next__meta { display: block; margin-top: 14px; font-size: .9375rem; color: rgba(255,255,255,.8); }
.pd-next__arrow {
  position: absolute; right: var(--gutter); top: 50%; width: 72px; height: 72px; padding: 20px; margin-top: -36px;
  border: 1px solid rgba(255,255,255,.5); border-radius: 50%; transition: background .3s, color .3s, transform .4s var(--px-ease);
}
.pd-next:hover img { transform: scale(1.04); opacity: .7; }
.pd-next:hover .pd-next__arrow { background: #fff; color: var(--oxblood); transform: translateX(6px); }
.pd-next:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .pd-overview__grid { grid-template-columns: 1fr; }
  .pd-aside { position: static; max-width: 560px; }
  .pd-facts__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pd-facts__grid > div:nth-child(3n+1) { border-left: 0; padding-left: 0; }
  .pd-facts__grid > div:nth-child(n+4) { border-top: 1px solid var(--rule-dark); }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  .pd-hero { min-height: 72vh; }
  .pd-hero .px-crumb li:last-child { display: none; }

  .pd-facts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-facts__grid > div { padding: 20px 16px 22px; border-left: 1px solid var(--rule-dark); border-top: 0; }
  .pd-facts__grid > div:nth-child(3n+1) { border-left: 1px solid var(--rule-dark); padding-left: 16px; }
  .pd-facts__grid > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .pd-facts__grid > div:nth-child(n+3) { border-top: 1px solid var(--rule-dark); }

  .pd-aside { padding: 24px 20px; }

  /* Gallery becomes a swipeable strip */
  .pd-gallery .container { padding-inline: 0; }
  .pd-gallery .pd-section-head { padding-inline: var(--gutter); }
  .pd-mosaic, .pd-mosaic--2, .pd-mosaic--3, .pd-mosaic--4 {
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--gutter) 8px;
    scroll-padding-inline: var(--gutter); scrollbar-width: none;
  }
  .pd-mosaic::-webkit-scrollbar { display: none; }
  .pd-mosaic > li { flex: 0 0 84%; aspect-ratio: 4 / 3; scroll-snap-align: start; }
  .pd-tile__icon { opacity: 1; transform: none; width: 34px; height: 34px; padding: 8px; }


  .pd-next__arrow { position: static; display: block; margin: 24px 0 0; width: 56px; height: 56px; padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-hero__bg { animation: none; transform: none; }
  .pd-hero.is-ongoing .pd-hero__state::before { animation: none; }
  .pd-tile img, .pd-next img, .pd-next__arrow { transition: none; }
}
