/**
 * Impactiqa — work.css
 * Work/portfolio panel page — full grid layout.
 * Dark background (#0a0a0a).
 * Phase 5: filterable case card grid with responsive <picture> images.
 */

/* ── Panel variables ──────────────────────────────────────────────────────── */
:root {
  --panel-mute: rgba(247,246,244,.55);
  --panel-rule: rgba(247,246,244,.15);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
html, body { height: 100%; }
body {
  background: var(--panel-bg, #0a0a0a);
  color: var(--panel-fg, #f7f6f4);
  overflow-x: hidden;
}
main {
  min-height: 100vh;
  padding-top: 140px;
  padding-bottom: 96px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.work-hero {
  padding: 0 8vw 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.work-hero .headline {
  margin-top: 8px;
}
.work-count {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--panel-mute);
  margin-top: -8px;
}

/* ── Filter bar ───────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 8vw 48px;
}
.filter-pill {
  background: transparent;
  color: var(--panel-fg, #f7f6f4);
  border: 1px solid rgba(247,246,244,.2);
  padding: 8px 20px;
  border-radius: 999px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.filter-pill:hover {
  border-color: rgba(247,246,244,.5);
}
.filter-pill.active {
  background: #f7f6f4;
  color: #0a0a0a;
  border-color: #f7f6f4;
}

/* ── Case grid ────────────────────────────────────────────────────────────── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: #111;
}

/* ── Work card ────────────────────────────────────────────────────────────── */
.work-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  text-decoration: none;
  color: #f7f6f4;
  cursor: pointer;
  background: #111;
}
.work-card[hidden] {
  display: none;
}

/* Responsive hero image */
.work-card-picture {
  position: absolute;
  inset: 0;
  display: block;
}
.work-card-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .7s cubic-bezier(.25,.46,.45,.94);
}
.work-card:hover .work-card-picture img {
  transform: scale(1.05);
}

/* Gradient overlay */
.work-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.85) 0%,
    rgba(0,0,0,.3)  50%,
    rgba(0,0,0,.1)  100%
  );
  transition: opacity .3s;
}
.work-card:hover .work-card-overlay {
  opacity: .9;
}

/* Client logo — top-right, white-filtered */
.work-card-logo {
  position: absolute;
  top: 20px;
  right: 20px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.work-card-logo img {
  max-height: 28px;
  max-width: 80px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .75;
}

/* Card body */
.work-card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .4s cubic-bezier(.25,.46,.45,.94);
}
.work-card:hover .work-card-body {
  transform: translateY(-6px);
}

.work-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.work-card-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(247,246,244,.5);
}
.work-card-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(247,246,244,.4);
  border: 1px solid rgba(247,246,244,.2);
  padding: 3px 8px;
  border-radius: 999px;
}
.work-card-client {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.work-card-headline {
  font-size: 13px;
  font-weight: 300;
  color: rgba(247,246,244,.6);
  line-height: 1.4;
  max-width: 90%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.work-card-arrow {
  font-size: 20px;
  color: #f7f6f4;
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity .3s, transform .3s;
  align-self: flex-end;
  margin-top: 4px;
}
.work-card:hover .work-card-arrow {
  opacity: 1;
  transform: translate(0, 0);
}

/* ── CTA strip ────────────────────────────────────────────────────────────── */
.work-cta-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 48px 8vw;
  border-top: 1px solid var(--panel-rule);
  margin-top: 2px;
}
.work-cta-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(28px, 3vw, 48px);
  font-weight: 700;
  letter-spacing: -.02em;
}
.work-cta-btn {
  display: inline-flex;
  text-decoration: none;
  flex-shrink: 0;
}
.work-cta-btn .vl {
  background: #f7f6f4;
  color: #0a0a0a;
  padding: 14px 28px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.work-cta-btn .vi {
  background: #39FF14;
  color: #0a0a0a;
  padding: 14px 16px;
  font-size: 16px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .work-hero {
    padding: 0 6vw 48px;
  }
  .filter-bar {
    padding: 0 6vw 40px;
  }
  .work-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .work-card {
    aspect-ratio: 4 / 3;
  }
  .work-cta-strip {
    flex-direction: column;
    gap: 28px;
    align-items: flex-start;
    padding: 48px 6vw;
  }
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .work-card-picture img,
  .work-card-body,
  .work-card-arrow { transition: none; }
}
