/* ════════════════════════════════
   WORK PAGE — full standalone /work
   Mirrors services-page hero pattern + Bogdan-style case study grid
   Same dark theme, lime accent, Aktiv Grotesk
════════════════════════════════ */

.page-work {
  background: var(--color-bg);
  color: var(--color-white);
  position: relative;
  z-index: 2;
}

/* ════════════════════════════════
   1. HERO — same shell as .svc-hero (consistency)
════════════════════════════════ */

.work-hero {
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.5vw, 40px);
  padding: clamp(180px, 22vw, 320px) 0 0;
  position: relative;
  overflow: hidden;
}

.work-hero__top {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3vw, 48px);
  padding: 0 clamp(20px, 3.5vw, 50px);
}

.work-hero__heading {
  font-family: var(--font-display);
  font-size: clamp(56px, 13vw, 240px);
  font-weight: var(--weight-medium);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--color-white);
  margin: 0;
  text-transform: none;
  white-space: nowrap;
  display: block;
  visibility: hidden;
}

.work-hero__media {
  position: relative;
  width: 100%;
  height: clamp(360px, 52vh, 640px);
  overflow: hidden;
  background: var(--color-bg);
  clip-path: inset(0 100% 0 0);
}

.work-hero__media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.12);
}

.work-hero__media-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
}

.work-hero__row {
  position: absolute;
  left:  clamp(20px, 3.5vw, 50px);
  right: clamp(20px, 3.5vw, 50px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: none;
}

.work-hero__row-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  gap: 16px;
  flex-wrap: wrap;
}

.work-hero__row-labels span {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1vw, 16px);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--color-white);
  white-space: nowrap;
  letter-spacing: 0;
}

.work-hero__row-line {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
}

/* ════════════════════════════════
   2. GRID HEADER — "Selected Work (N)" + intro
════════════════════════════════ */

.work-grid-section {
  padding: clamp(40px, 5vw, 80px) clamp(20px, 3.5vw, 50px) clamp(40px, 5vw, 80px);
  background: var(--color-bg);
  position: relative;
}

.work-grid__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(20px, 3vw, 48px);
  flex-wrap: wrap;
  margin-bottom: clamp(24px, 3vw, 48px);
  padding-bottom: clamp(16px, 1.8vw, 28px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.work-grid__title {
  font-family: var(--font-display);
  font-size: clamp(36px, 4.4vw, 72px);
  font-weight: var(--weight-medium);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--color-white);
  margin: 0;
  text-transform: none;
  /* Pre-hide for FOUC protection — JS reveals via SplitText word reveal */
  visibility: hidden;
}

.work-grid__title-count {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 0.55em;
  letter-spacing: 0;
  margin-left: 0.25em;
  vertical-align: top;
  position: relative;
  top: 0.5em;
}

.work-grid__intro {
  font-family: var(--font-mono);
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.5;
  color: var(--color-text-muted);
  max-width: 38ch;
  margin: 0;
}

/* ════════════════════════════════
   3. GRID — 2-col desktop, 1-col mobile
   Bogdan-inspired hover: badges slide in + highlight image swap
════════════════════════════════ */

.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 5vw, 80px) clamp(24px, 2.4vw, 40px);
  align-items: start;
}

@media (max-width: 768px) {
  .work-grid {
    grid-template-columns: 1fr;
    gap: clamp(48px, 8vw, 80px);
  }
}

/* ─── Card ─── */

.work-card {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  cursor: none; /* let custom cursor handle */
}

/* Default media — STANDARD 16:9 landscape */
.work-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: clamp(16px, 1.6vw, 26px);
  border-radius: 0;
}

/* Featured — spans full grid width, cinematic 21:9 */
.work-card.is-featured {
  grid-column: 1 / -1;
}
.work-card.is-featured .work-card__media {
  aspect-ratio: 21 / 9;
}

/* Tall — SQUARE 1:1 (creates mixed-height rows when paired with default 16:9) */
.work-card.is-tall .work-card__media {
  aspect-ratio: 1 / 1;
}

/* Wide — standard 1-col card with 16:8 aspect (slightly wider than default 16:9) */
.work-card.is-wide .work-card__media {
  aspect-ratio: 16 / 8;
}

@media (max-width: 768px) {
  /* On mobile single col, normalize all aspects to 16:9 for consistency */
  .work-card.is-featured .work-card__media,
  .work-card.is-tall .work-card__media,
  .work-card.is-wide .work-card__media {
    aspect-ratio: 16 / 9;
  }
}

.work-card__media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.05, 1);
  will-change: transform;
}

/* Highlight image — sits on top, hidden by default, fades in + scales up on hover */
.work-card__highlight {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.55s cubic-bezier(0.65, 0, 0.05, 1),
              transform 0.7s cubic-bezier(0.65, 0, 0.05, 1);
  pointer-events: none;
  will-change: opacity, transform;
}

/* Floating badges — bottom-right of media, FADE in on hover (no transform).
   Pure opacity hide → no edge peeking, no transform clip issues. */
.work-card__badges {
  position: absolute;
  bottom: clamp(16px, 1.8vw, 28px);
  right:  clamp(16px, 1.8vw, 28px);
  display: flex;
  gap: 8px;
  z-index: 4;             /* above pixel overlay (z:3) so badges visible on hover */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.65, 0, 0.05, 1);
  will-change: opacity;
}

.work-card__badge {
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.75vw, 12px);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  background: var(--color-accent);
  color: var(--color-black);
  border-radius: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.work-card__badge--ghost {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-black);
}

/* ─── Hover state on card ─── */

.work-card:hover .work-card__media-img {
  transform: scale(1.04);
}

.work-card:hover .work-card__highlight {
  opacity: 1;
  transform: scale(1);
}

.work-card:hover .work-card__badges {
  opacity: 1;
}

/* ─── Bottom info: 2-col rows (label | content) — madeinevolve pattern ─── */

.work-card__info {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 0.8vw, 14px);
}

.work-card__info-row {
  display: grid;
  grid-template-columns: minmax(80px, 14%) 1fr;
  gap: clamp(16px, 2vw, 32px);
  align-items: start;
}

/* Label (left col) — PARTNER / SERVICES */
.work-card__label {
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.75vw, 12px);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* Brand name (right col, top row) */
.work-card__title {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.05vw, 18px);
  font-weight: var(--weight-medium);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--color-white);
  margin: 0;
  text-transform: none;
  /* Subtle hover effect — title shifts color */
  transition: color 0.3s ease;
}

.work-card:hover .work-card__title {
  color: var(--color-accent);
}

/* Services list (right col, bottom row) */
.work-card__services {
  font-family: var(--font-display);
  font-size: clamp(13px, 0.95vw, 16px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--color-white);
  margin: 0;
}

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */

@media (max-width: 600px) {
  .work-grid__head {
    flex-direction: column;
    align-items: flex-start;
  }
  .work-card__info-row {
    /* Slightly smaller label col on mobile */
    grid-template-columns: minmax(64px, 22%) 1fr;
    gap: 12px;
  }
}

/* ════════════════════════════════
   PIXELATED REVEAL OVERLAY
   Generated by JS — covers card image, fades out cell-by-cell as card scrolls in
════════════════════════════════ */

.work-card__pixel-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;             /* above image + highlight, below badges (z:4) */
  pointer-events: none;
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
}

.work-card__pixel-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-width: 0;
}

.work-card__pixel {
  flex: 1 1 0%;
  background-color: var(--color-bg);   /* dark — matches page bg */
  backface-visibility: hidden;
  will-change: opacity;
}

/* ════════════════════════════════
   REDUCED MOTION
════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .work-card__media-img,
  .work-card__highlight,
  .work-card__badges,
  .work-card__title { transition: none; }
  .work-card__pixel-overlay { display: none; }
}
