/* ==========================================================================
   Projects / Work Catalog — Bunq Labs Design System Alignment
   Tran Huy Hoang · Full-Stack & AI Engineer
   ========================================================================== */

:root {
  --sq-night: #f7f6f2;
  --sq-coal: #ffffff;
  --sq-graphite: #ebe7df;
  --sq-surface-card: #ffffff;
  --sq-ink: #16140f;
  --sq-ink-dim: rgba(22, 20, 15, 0.72);
  --sq-ink-muted: rgba(22, 20, 15, 0.46);
  --sq-line: rgba(22, 20, 15, 0.1);
  --sq-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, 0.03) 100%);
  --sq-edge: inset 0 1px 0 #ffffff, 0 1px 3px rgba(0, 0, 0, 0.05);
  --sq-accent: #ff4d2e;
  --sq-accent-soft: rgba(255, 77, 46, 0.1);
  --sq-font-sans: "Inter Tight", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sq-font-display: "Bricolage Grotesque", "Inter Tight", sans-serif;
  --sq-font-serif: "Instrument Serif", Georgia, serif;
  --sq-font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  --sq-radius: 14px;
  --sq-radius-xl: 18px;
  --sq-radius-2xl: 24px;
  --sq-radius-sm: 8px;
  --sq-radius-pill: 999px;
  --sq-transition: 0.45s cubic-bezier(0.215, 0.61, 0.355, 1);
  --sq-ease: cubic-bezier(0.625, 0.05, 0, 1);

  /* Bunq Labs Work Card Tokens (Light Mode) */
  --scene-work-card: #ffffff;
  --scene-work-card-edge: #eae6de;
  --scene-work-card-ink: #16140f;
  --scene-work-rays: #ffffff;
  --sticker: 0 0.25rem 0.6rem rgba(22, 20, 15, 0.06), 0 0.8rem 2rem rgba(22, 20, 15, 0.08);
}

html.dark {
  --sq-night: #0f0e0c;
  --sq-coal: #1c1b19;
  --sq-graphite: #262523;
  --sq-surface-card: #1c1b19;
  --sq-ink: #f1efea;
  --sq-ink-dim: rgba(241, 239, 234, 0.65);
  --sq-ink-muted: rgba(241, 239, 234, 0.42);
  --sq-line: rgba(255, 255, 255, 0.09);
  --sq-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.08) 100%);
  --sq-edge: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --sq-accent-soft: rgba(255, 77, 46, 0.16);

  /* Bunq Labs Work Card Tokens (Dark Mode) */
  --scene-work-card: #181716;
  --scene-work-card-edge: #2a2926;
  --scene-work-card-ink: #f1efea;
  --scene-work-rays: #ffffff;
  --sticker: 0 0.25rem 0.6rem rgba(0, 0, 0, 0.4), 0 0.8rem 2.2rem rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Page Layout
   ========================================================================== */

.bunq-projects-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-color: var(--sq-night);
  color: var(--sq-ink);
  font-family: var(--sq-font-sans);
  padding: clamp(4rem, 7vw, 7rem) clamp(1.25rem, 4vw, 4rem) 5rem;
  box-sizing: border-box;
  overflow-x: hidden;
  border-top: 1px solid var(--sq-line);
  cursor: auto;
}

.bunq-projects-page a,
.bunq-projects-page button,
.bunq-projects-page .work-card,
.bunq-projects-page .bunq-filter-btn,
.bunq-projects-page .bunq-btn {
  cursor: pointer;
}

.bunq-projects__wrap {
  max-width: 1320px;
  margin: 0 auto;
}

/* Hero Section */
.bunq-hero {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  max-width: 52rem;
}

.bunq-eyebrow {
  margin: 0 0 1rem;
  font-family: var(--sq-font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sq-ink-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bunq-eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--sq-accent);
}

.bunq-hero__title {
  margin: 0 0 1.25rem;
  font-family: var(--sq-font-display);
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--sq-ink);
}

.bunq-hero__title em {
  font-family: var(--sq-font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--sq-ink);
  padding-left: 0.05em;
}

.bunq-hero__lede {
  margin: 0 0 2rem;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.6;
  color: var(--sq-ink-dim);
  max-width: 44rem;
}

.bunq-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--sq-line);
  border-bottom: 1px solid var(--sq-line);
  font-family: var(--sq-font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--sq-ink-muted);
}

.bunq-hero__stat-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.bunq-hero__stat-item strong {
  font-size: 1.15rem;
  font-family: var(--sq-font-display);
  font-weight: 600;
  color: var(--sq-ink);
}

/* ==========================================================================
   Filter Bar & Category Pills
   ========================================================================== */

.bunq-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2.5rem 0 3rem;
  padding-bottom: 1rem;
}

.bunq-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bunq-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: var(--sq-radius-pill);
  border: 1px solid var(--sq-line);
  background: transparent;
  color: var(--sq-ink-dim);
  font-family: var(--sq-font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.bunq-filter-btn:hover {
  background: var(--sq-graphite);
  color: var(--sq-ink);
  border-color: rgba(255, 77, 46, 0.3);
}

.bunq-filter-btn.is-active {
  background: var(--sq-ink);
  color: var(--sq-night);
  border-color: var(--sq-ink);
}

.bunq-filter-btn .filter-count {
  font-size: 0.68rem;
  opacity: 0.6;
}

.bunq-filter-btn.is-active .filter-count {
  opacity: 0.85;
}

.bunq-view-meta {
  font-family: var(--sq-font-mono);
  font-size: 0.75rem;
  color: var(--sq-ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ==========================================================================
   The Bunq Labs Work Card (.work-card)
   ========================================================================== */

.bunq-work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: clamp(1.5rem, 2.8vw, 2.5rem);
  margin-bottom: 5rem;
}

.work-card {
  --tint-top: 36%;
  --tint-tab: 33%;
  --tint-foot: 14%;
  --card-faint: color-mix(in srgb, var(--scene-work-card-ink) 55%, transparent);
  --pad: 0.875rem;
  
  padding: var(--pad);
  border-radius: var(--sq-radius-2xl);
  background: linear-gradient(
    color-mix(in srgb, var(--brand) var(--tint-top), var(--scene-work-card)),
    color-mix(in srgb, var(--brand) var(--tint-foot), var(--scene-work-card))
  );
  box-shadow: 0 0.1875rem 0 var(--scene-work-card-edge), var(--sticker);
  color: var(--scene-work-card-ink);
  -webkit-tap-highlight-color: transparent;
  flex-direction: column;
  text-decoration: none;
  display: flex;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  box-sizing: border-box;
}

html.light .work-card {
  --tint-top: 32%;
  --tint-tab: 28%;
  --tint-foot: 12%;
}

.work-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.35rem 0 var(--scene-work-card-edge), 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
}

.work-card:after {
  content: "";
  border-radius: inherit;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--scene-work-rays) 40%, transparent),
              inset 0 0 0 1px color-mix(in srgb, var(--scene-work-card-ink) 8%, transparent);
  pointer-events: none;
  position: absolute;
  inset: 0;
}

/* Card Media (Square 1:1) */
.work-card__media {
  display: block;
  position: relative;
  border-radius: var(--sq-radius-xl);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: color-mix(in srgb, var(--brand) 18%, #11100e);
}

.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

/* Custom Interactive Mockup Art inside Media */
.work-card__media .art {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.5s ease;
}

.work-card:hover .work-card__media .art {
  transform: scale(1.02);
}

/* Recessed Top Pill Tab */
.work-card__tab {
  text-overflow: ellipsis;
  background: color-mix(in srgb, var(--brand) var(--tint-tab), var(--scene-work-card));
  max-width: 80%;
  font-family: var(--sq-font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--card-faint);
  padding: 0.38rem 0.85rem;
  line-height: 1;
  position: absolute;
  left: 50%;
  overflow: hidden;
  translate: -50%;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.work-card__tab--top {
  top: calc(var(--pad) * -1);
  padding-top: calc(var(--pad) - 0.12em);
  border-radius: 0 0 var(--sq-radius-sm) var(--sq-radius-sm);
  border: 1px solid color-mix(in srgb, var(--scene-work-card-ink) 10%, transparent);
  border-top: none;
}

/* Card Title */
.work-card__title {
  -webkit-line-clamp: 2;
  font-family: var(--sq-font-sans);
  font-weight: 600;
  font-size: 1.15rem;
  -webkit-box-orient: vertical;
  min-height: 2.4em;
  margin: 0.85rem 0.35rem 0.4rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  display: -webkit-box;
  overflow: hidden;
  color: var(--scene-work-card-ink);
}

/* Card Foot */
.work-card__foot {
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0.35rem 0.25rem;
  display: flex;
}

.work-card__brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sq-font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--scene-work-card-ink);
}

.work-card__logo-icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
  flex: none;
}

.work-card__services {
  -webkit-line-clamp: 1;
  text-align: right;
  font-family: var(--sq-font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--card-faint);
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
}

/* Action hint pill on hover */
.work-card__action {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--sq-ink);
  color: var(--sq-night);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.work-card__action svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.work-card:hover .work-card__action {
  opacity: 1;
  transform: translateY(0);
}

/* Live demo CTA — always visible, sibling of card content */
.work-card__live {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: calc(100% - 0.7rem);
  margin: 0.75rem 0.35rem 0.2rem;
  padding: 0.62rem 1rem;
  border-radius: var(--sq-radius-pill, 999px);
  background: var(--scene-work-card-ink);
  color: var(--scene-work-card);
  font-family: var(--sq-font-mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 0.2s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.work-card__live:hover,
.work-card__live:focus-visible {
  transform: scale(1.02);
  opacity: 0.92;
  outline: none;
}

.work-card__live svg {
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
}

.work-card:has(.work-card__live) .work-card__action {
  display: none;
}

/* ==========================================================================
   Bunq Labs Bottom Bar & Controls (.work-bar)
   ========================================================================== */

.work-bar-container {
  display: flex;
  justify-content: center;
  margin: 3rem 0;
}

.work-bar {
  color: var(--sq-ink);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  display: grid;
  padding: 0.75rem 1.75rem;
  background: var(--sq-surface-card);
  border: 1px solid var(--sq-line);
  border-radius: var(--sq-radius-pill);
  box-shadow: var(--sq-edge);
}

.work-bar__count,
.work-bar__year {
  font-family: var(--sq-font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sq-ink-muted);
  margin: 0;
  line-height: 1.2;
}

.work-bar__count {
  text-align: right;
}

.work-bar__year {
  text-align: left;
}

.work-bar__open {
  white-space: nowrap;
  background: var(--sq-ink);
  color: var(--sq-night);
  border-radius: var(--sq-radius-pill);
  padding: 0.5rem 1.25rem;
  font-family: var(--sq-font-mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.work-bar__open:hover {
  transform: scale(1.03);
  opacity: 0.92;
}

.work-bar__open svg {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   Bunq Labs Call To Action (Bottom Footer Pre-band)
   ========================================================================== */

.bunq-work-cta {
  margin-top: 6rem;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3.5rem);
  background: var(--sq-surface-card);
  border: 1px solid var(--sq-line);
  border-radius: var(--sq-radius-2xl);
  box-shadow: var(--sq-edge);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.bunq-work-cta::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--sq-accent-soft) 0%, transparent 70%);
  pointer-events: none;
}

.bunq-work-cta__title {
  margin: 0;
  font-family: var(--sq-font-display);
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--sq-ink);
}

.bunq-work-cta__title em {
  font-family: var(--sq-font-serif);
  font-style: italic;
  font-weight: 400;
}

.bunq-work-cta__text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--sq-ink-dim);
  max-width: 36rem;
}

.bunq-work-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.bunq-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--sq-radius-pill);
  font-family: var(--sq-font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.bunq-btn--primary {
  background: var(--sq-ink);
  color: var(--sq-night);
  border: 1px solid var(--sq-ink);
}

.bunq-btn--primary:hover {
  background: var(--sq-accent);
  border-color: var(--sq-accent);
  color: #ffffff;
  transform: translateY(-2px);
}

.bunq-btn--ghost {
  background: transparent;
  color: var(--sq-ink);
  border: 1px solid var(--sq-line);
}

.bunq-btn--ghost:hover {
  background: var(--sq-graphite);
  color: var(--sq-ink);
  border-color: rgba(22, 20, 15, 0.2);
}

html.dark .bunq-btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

@keyframes bunqFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .bunq-work-grid {
    grid-template-columns: 1fr;
  }
  .bunq-filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .work-bar {
    width: 100%;
    justify-content: space-between;
  }
  .work-card__live {
    padding: 0.7rem 1rem;
    font-size: 0.8rem;
  }
}
