/* =====================================================================
   bhavitverma.com v4 — Work list + project detail
   ===================================================================== */

/* ---------- Work hero ---------- */
.workhero {
  position: relative; z-index: var(--z-section);
  padding-top: calc(var(--hero-pt) + 4rem); padding-bottom: 4rem;
  text-align: center; background: var(--bg);
}
.workhero h1 { max-width: 12em; margin-inline: auto; }
.workhero__sub { max-width: 34rem; margin: 2rem auto 0; text-wrap: pretty; }

/* ---------- Folio ---------- */
.folio { position: relative; z-index: var(--z-section); background: var(--bg); padding-bottom: 2rem; }

/* Filter pill — sticky on desktop, fixed to the bottom ≤991 */
.filter {
  position: sticky; top: 0; z-index: var(--z-overlay);
  display: flex; justify-content: center;
  padding-block: 1.375rem; pointer-events: none;
}
.filter__pill {
  pointer-events: auto;
  width: auto; max-width: min(40rem, 100%);
  border-radius: var(--r-md);
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transition: border-radius 0.5s var(--ease-pill);
}
.filter.is-open .filter__pill { border-radius: var(--r-sm); width: 40rem; }
.filter__bar { display: flex; align-items: center; justify-content: center; height: 2.5rem; padding-inline: 0.5rem; }
.filter__group {
  display: inline-flex; align-items: center; gap: 0.5rem;
  height: 100%; padding-inline: 0.75rem;
  font-family: var(--font-mono); font-size: var(--link); line-height: 1; text-transform: uppercase;
}
.filter__label { color: rgba(255, 255, 255, 0.65); }
.filter__value { color: var(--fg); }
.filter__group .icon { transition: transform 0.4s var(--ease-pill); }
.filter__group[aria-expanded="true"] .icon { transform: rotate(180deg); }
.filter__sep { width: 1px; height: 1rem; background: var(--hairline); }
.filter__drop {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease-pill);
}
.filter.is-open .filter__drop { grid-template-rows: 1fr; }
.filter__inner { overflow: hidden; min-height: 0; }
.filter__opts {
  display: none; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1rem;
  padding: 0.75rem 1.5rem 1.5rem;
  opacity: 0; transition: opacity 0.3s ease 0.25s;
}
.filter__opts.is-shown { display: flex; }
.filter.is-open .filter__opts.is-shown { opacity: 1; }
.filter__opt {
  font-size: var(--b-xl); line-height: 1.2; padding-block: 0.375rem;
  color: rgba(255, 255, 255, 0.45); transition: color var(--t-color);
}
.filter__opt:hover, .filter__opt:focus-visible { color: rgba(255, 255, 255, 0.85); }
.filter__opt.is-active { color: var(--fg); }

/* Card grid: 2 equal columns, 8px gap */
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.fcard {
  display: grid; grid-template-rows: minmax(0, 1fr) 0rem;
  aspect-ratio: 4 / 3;
  transition: grid-template-rows 0.5s var(--ease-nav);
}
.fcard.is-hidden { display: none; }
.fcard__media { position: relative; border-radius: var(--r-sm); overflow: clip; min-height: 0; }
.fcard__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s var(--ease-nav);
}
.fcard__caption {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  overflow: hidden; min-height: 0; padding-inline: 0.125rem;
}
.fcard__title { font-size: var(--b-lg); }
.fcard__cat { font-size: var(--b-lg); color: var(--text-muted); white-space: nowrap; }

@media (hover: hover) and (min-width: 768px) {
  .fcard:hover, .fcard:focus-visible { grid-template-rows: minmax(0, 1fr) 2.5rem; }
  .fcard:hover .fcard__media img { transform: scale(1.025); }
}
@media (max-width: 991px) {
  .filter { position: fixed; top: auto; bottom: 0; left: 0; right: 0; padding: 1rem var(--gutter); }
  .filter__pill { display: flex; flex-direction: column-reverse; }
  .filter.is-open .filter__pill { width: 100%; }
  .filter__group { min-height: 2.75rem; }
  .folio { padding-bottom: 6rem; }
}
@media (max-width: 767px) {
  .fgrid { grid-template-columns: 1fr; gap: 1rem; }
  .fcard { aspect-ratio: auto; display: block; }
  .fcard__media { aspect-ratio: 4 / 3; }
  .fcard__caption { padding-block: 0.75rem 0.25rem; }
  .fcard__cat { font-size: var(--b-sm); }
}
@media (max-width: 479px) {
  .filter__label { display: none; }
}

/* ---------- Project detail ---------- */
.project { position: relative; z-index: var(--z-section); background: var(--bg); padding-top: var(--hero-pt); }
.project__grid { display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); column-gap: var(--gap); }
.project__overview {
  grid-column: 1 / 6;
  position: sticky; top: var(--hero-pt);
  height: calc(100svh - var(--hero-pt) - var(--gutter));
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding-right: 1.5rem;
}
.project__back { display: inline-flex; padding-block: 0.5rem; color: var(--text-muted); transition: color var(--t-color); }
.project__back::before { content: "←"; margin-right: 0.5rem; font-family: var(--font-body); }
.project__back:hover { color: var(--fg); }
.project__title { font-size: var(--h-sm); line-height: 1.05; margin-top: 1.5rem; }
.project__tags { display: flex; flex-wrap: wrap; gap: 0.5rem 0; margin-top: 1.25rem; color: var(--text-2); }
.project__tags li { display: inline-flex; align-items: center; }
.project__tags li + li::before { content: "✱"; color: var(--accent); margin-inline: 0.625rem; font-size: 0.75em; }
.project__bottom { display: flex; flex-direction: column; gap: 1.5rem; }
.project__idea { font-size: var(--h-xs); line-height: 1.1; margin-top: 0.5rem; }
.project__why { color: var(--text-muted); text-wrap: pretty; }
.project__pillars { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.75rem; }
.project__pillars li { padding: 0.375rem 0.625rem; border-radius: var(--r-full); background: var(--surface); font-size: var(--b-sm); }
.project__note { color: var(--text-subtle); }

.gallery { grid-column: 6 / 19; margin-right: calc(var(--gutter) * -1); }
.gallery__item { position: relative; scroll-margin-top: 0; }
.gallery__media { position: relative; aspect-ratio: 4 / 3; overflow: clip; }
.gallery__media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 991px) {
  .project__overview { grid-column: 1 / 8; }
  .gallery { grid-column: 8 / 19; }
}
@media (max-width: 767px) {
  .project__grid { display: block; }
  .project__overview { position: static; height: auto; padding-right: 0; padding-bottom: 2.5rem; }
  .gallery { margin-inline: calc(var(--gutter) * -1); }
}

