/* works.html ================================================== */

/* HERO right-side collage */
.works-hero-visual {
  position: absolute;
  top: 96px;
  right: 48px;
  width: min(348px, 33vw);
  height: min(340px, 32vw);
  pointer-events: none;
  z-index: 0;
}
.whv-photo {
  position: absolute;
  background-size: cover;
  background-position: center;
  filter: saturate(0.75) contrast(1.05);
}
.whv-a {
  top: 0; right: 23%;
  width: 61%;
  aspect-ratio: 3 / 4;
}
.whv-a::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent);
  transform: translate(14px, 14px);
  opacity: 0.55;
}
.whv-b {
  bottom: 0; right: 0;
  width: 49%;
  aspect-ratio: 4 / 3;
  box-shadow: 0 24px 60px rgba(10, 31, 61, 0.18);
}
.whv-stamp {
  position: absolute;
  top: -42px; right: 73%;
  width: 104px;
  height: 104px;
  color: var(--accent);
}
.whv-stamp svg {
  width: 100%;
  height: 100%;
  animation: whv-spin 26s linear infinite;
  font-family: var(--sans);
}
@keyframes whv-spin {
  to { transform: rotate(360deg); }
}
.whv-cap {
  position: absolute;
  top: 8px; right: 14%;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--navy);
  opacity: 0.55;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}
@media (max-width: 960px) {
  .works-hero-visual { display: none; }
}

.works-hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 24px;
}
.works-hero-meta-stat {
  font-family: var(--sans);
}
.works-hero-meta-stat .num {
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 300;
  color: var(--navy-deep);
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
  line-height: 1;
}
.works-hero-meta-stat .num .unit { font-size: 16px; opacity: 0.55; margin-left: 4px; }
.works-hero-meta-stat .label {
  font-size: 10px; letter-spacing: 0.3em;
  margin-top: 6px;
  color: var(--navy); opacity: 0.55;
  text-transform: uppercase;
}

/* FILTER BAR */
.works-filter {
  padding: 24px 48px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  position: sticky;
  top: 84px;
  z-index: 10;
  backdrop-filter: saturate(1.2) blur(10px);
  background: rgba(245,242,236,0.92);
}
.works-filter-label {
  font-family: var(--sans);
  font-size: 10px; letter-spacing: 0.3em;
  color: var(--navy); opacity: 0.55;
  margin-right: 16px;
  text-transform: uppercase;
}
.works-filter-btn {
  font-family: var(--sans);
  font-size: 12px; font-weight: 500;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--navy-deep);
  cursor: pointer;
  letter-spacing: 0.05em;
  border-radius: 0;
  transition: background .2s, border-color .2s, color .2s;
}
.works-filter-btn:hover { border-color: var(--accent); }
.works-filter-btn.active {
  background: var(--navy-deep);
  color: var(--paper);
  border-color: var(--navy-deep);
}
.works-filter-btn .count {
  font-size: 9px;
  margin-left: 6px;
  opacity: 0.5;
  font-feature-settings: "tnum";
  letter-spacing: 0;
}

/* GRID */
.works-grid-wrap {
  padding: 64px 48px 120px;
  background: var(--paper);
}
.works-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.work-item {
  position: relative;
  text-decoration: none;
  color: var(--ink);
  display: block;
  background: var(--navy-deep);
  overflow: hidden;
}
.work-item .img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: saturate(0.78) contrast(1.06);
  transition: transform 1.2s cubic-bezier(.2,.7,.3,1), filter .4s;
}
.work-item:hover .img { transform: scale(1.07); }
.work-item image-slot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  --slot-bg: rgba(10,31,61,0.5);
  --slot-fg: rgba(245,242,236,0.5);
  filter: saturate(0.78) contrast(1.06);
  transition: transform 1.2s cubic-bezier(.2,.7,.3,1), filter .4s;
}
.work-item:hover image-slot {
  transform: scale(1.06);
  filter: saturate(0.95) contrast(1.06);
}
.work-item .scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,31,61,0) 50%, rgba(10,31,61,0.85) 100%);
}
.work-item .body {
  position: absolute;
  left: 20px; right: 20px; bottom: 20px;
  color: var(--paper);
  font-family: var(--sans);
}
.work-item .body .cat {
  font-size: 9px; letter-spacing: 0.32em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.work-item .body .title {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.work-item .top {
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  display: flex; justify-content: space-between;
  font-family: var(--sans);
  font-size: 9px; letter-spacing: 0.3em;
  color: var(--paper); opacity: 0.85;
  text-transform: uppercase;
}
.work-item .top .num { color: var(--accent); }
.work-item::after {
  content: "";
  position: absolute;
  top: 12px; left: 12px;
  width: 12px; height: 12px;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
  z-index: 2;
}

/* spans */
.work-item.s-6 { grid-column: span 6; aspect-ratio: 4/3; }
.work-item.s-4 { grid-column: span 4; aspect-ratio: 3/4; }
.work-item.s-3 { grid-column: span 3; aspect-ratio: 1/1; }
.work-item.s-8 { grid-column: span 8; aspect-ratio: 16/9; }
.work-item.s-12 { grid-column: span 12; aspect-ratio: 21/9; }

/* hidden via filter */
.work-item.is-filtered-out {
  display: none;
}

/* re-entry animation when the filter changes */
@keyframes work-pop {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.works-grid.is-animating .work-item:not(.is-filtered-out) {
  animation: work-pop .45s cubic-bezier(.2,.7,.3,1) both;
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .works-filter {
    top: 72px;
    padding: 16px 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .works-filter-label { display: none; }
  .works-filter-btn { white-space: nowrap; }
  .works-grid-wrap { padding: 32px 20px 64px; }
  .works-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .work-item.s-6, .work-item.s-4, .work-item.s-3, .work-item.s-8, .work-item.s-12 {
    grid-column: span 1;
    aspect-ratio: 4/3;
  }
}
