/* Works — Selected Works index & category layouts */

.wk-page {
  --wk-max: 68rem;
  --wk-pad-x: clamp(1.25rem, 4vw, 2.5rem);
  --wk-row-max: min(100%, 56rem);
  --wk-img-max: min(100%, clamp(16rem, 76vw, 25rem));
  padding-top: 0;
}

@media (min-width: 992px) {
  .wk-page {
    --wk-img-max: 23rem;
    --wk-row-max: 58rem;
  }
}

.wk-page--category .wk-filters {
  margin-bottom: 0;
  border-top: none;
}

.wk-page .nav-link[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.35em;
  text-decoration-thickness: 1px;
}

/* ——— Hero (matches About page) ——— */
.wk-hero {
  position: relative;
  min-height: min(92dvh, 52rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(6rem, 14vw, 9rem) clamp(1.25rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4rem);
  background-color: #1a1918;
  background-size: cover;
  background-position: center 28%;
  background-repeat: no-repeat;
  color: #fff;
}

.wk-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.82) 16%,
    rgba(0, 0, 0, 0.64) 32%,
    rgba(0, 0, 0, 0.4) 48%,
    rgba(0, 0, 0, 0.14) 62%,
    transparent 82%
  );
  pointer-events: none;
}

.wk-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.25) 0%,
    rgba(0, 0, 0, 0.45) 50%,
    rgba(0, 0, 0, 0.72) 100%
  );
  pointer-events: none;
}

.wk-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 52rem;
}

.wk-hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 5.2vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 1.25rem;
}

.wk-hero-lead {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.35vw, 1.05rem);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.9);
  max-width: 38rem;
  margin-bottom: 0;
}

@media (max-width: 991.98px) {
  .wk-hero {
    min-height: min(88svh, 42rem);
    padding-top: clamp(5rem, 12vw, 6.5rem);
    background-position: 38% top;
  }

  .wk-hero::before {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.2) 0%,
      rgba(0, 0, 0, 0.08) 30%,
      rgba(0, 0, 0, 0.5) 65%,
      rgba(0, 0, 0, 0.86) 100%
    );
  }
}

/* ——— Category filters ——— */
.wk-filters {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(1rem, 2vw, 1.2rem) 0;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.wk-filters-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.65rem, 2vw, 1.5rem) clamp(1rem, 3vw, 2.25rem);
  max-width: var(--wk-max);
  margin: 0 auto;
  padding-left: var(--wk-pad-x);
  padding-right: var(--wk-pad-x);
}

.wk-filter {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0 0 0.2rem;
  margin: 0;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.wk-filter:hover {
  color: var(--text);
}

.wk-filter.is-active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.wk-project-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.5vw, 2.65rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.wk-project-meta {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-bottom: 0.85rem;
}

.wk-project-loc {
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.wk-project-client {
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 0.7rem;
}

.wk-project-desc {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 22rem;
  margin-bottom: 0;
}

/* ——— Category intro (shown when filtering) ——— */
.wk-cat-intro {
  max-width: var(--wk-max);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.25rem) var(--wk-pad-x) 0;
}

.wk-cat-intro-inner {
  max-width: 100%;
  width: 100%;
}

.wk-cat-intro[hidden],
.wk-hero[hidden] {
  display: none !important;
}

.wk-empty {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-soft);
  max-width: var(--wk-max);
  margin: 0 auto clamp(3rem, 7vw, 5rem);
  padding: 0 var(--wk-pad-x);
}

.wk-empty[hidden] {
  display: none !important;
}

.wk-cat-kicker {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.75rem;
}

.wk-cat-kicker::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 1px;
  background: rgba(26, 26, 26, 0.22);
  margin-top: 0.75rem;
}

.wk-cat-heading,
.wk-cat-intro-heading {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 70%;
  margin-bottom: 1.25rem;
}

.wk-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  border-bottom: 1px solid rgba(26, 26, 26, 0.35);
  padding: 0 0 2px;
  cursor: pointer;
  font-family: inherit;
}

.wk-back:hover {
  opacity: 0.75;
  color: var(--text);
}

.wk-back svg {
  width: 0.85rem;
  height: 0.85rem;
}

/* ——— Category alternating rows ——— */
.wk-cat-list {
  max-width: var(--wk-max);
  margin: 0 auto;
  padding-left: var(--wk-pad-x);
  padding-right: var(--wk-pad-x);
  padding-top: clamp(1.25rem, 3vw, 2rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.wk-cat-intro:not([hidden]) + .wk-filters {
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.wk-cat-intro:not([hidden]) ~ .wk-cat-list {
  padding-top: 0;
}

.wk-cat-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(3rem, 7vw, 4.5rem);
  padding-bottom: clamp(2.25rem, 5vw, 3.25rem);
  max-width: var(--wk-row-max);
  margin-left: auto;
  margin-right: auto;
  scroll-margin-top: clamp(5rem, 12vw, 7rem);
}

.wk-cat-item[hidden] {
  display: none !important;
}

.wk-cat-item:last-child:not([hidden]) {
  padding-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

@media (min-width: 992px) {
  .wk-cat-item {
    flex-direction: row;
    align-items: center;
    gap: clamp(4rem, 7vw, 6rem);
    margin-left: 0;
    margin-right: auto;
  }

  .wk-cat-item--flip {
    flex-direction: row-reverse;
    margin-left: auto;
    margin-right: 0;
  }

  .wk-cat-item-copy {
    flex: 1 1 14rem;
    min-width: 0;
    max-width: 18rem;
  }
}

.wk-cat-item-media {
  overflow: hidden;
  border-radius: 2px;
  background: #dedbd6;
  line-height: 0;
  width: 100%;
  max-width: var(--wk-img-max);
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
}

@media (min-width: 992px) {
  .wk-cat-item-media {
    width: var(--wk-img-max);
    max-width: var(--wk-img-max);
    margin: 0;
  }
}

.wk-cat-item-media img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 1.15s var(--ease);
}

.wk-cat-item:hover .wk-cat-item-media img {
  transform: scale(1.02);
}

.wk-cat-item-num {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.wk-cat-item-num::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 1px;
  background: rgba(26, 26, 26, 0.22);
  margin-top: 0.5rem;
  margin-bottom: 0.65rem;
}

/* ——— Archive block ——— */
.wk-archive {
  background: #efede9;
  border-top: 1px solid var(--line);
}

.wk-archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
  max-width: var(--wk-max);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 5.5rem) var(--wk-pad-x);
}

@media (min-width: 992px) {
  .wk-archive-grid {
    grid-template-columns: minmax(0, 0.48fr) minmax(0, 0.52fr);
    gap: 3rem;
  }
}

.wk-archive-kicker {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.85rem;
}

.wk-archive-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.wk-archive-lead {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 22rem;
  margin-bottom: 1.5rem;
}

.wk-archive-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(26, 26, 26, 0.35);
  padding-bottom: 2px;
}

.wk-archive-link:hover {
  opacity: 0.75;
  color: var(--text);
}

.wk-archive-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 12rem;
}

.wk-archive-fig {
  width: min(100%, 28rem);
  margin: 0;
  line-height: 0;
}

.wk-archive-fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  box-shadow:
    0.35rem 0.5rem 1.25rem rgba(0, 0, 0, 0.12),
    -0.15rem 0.25rem 0.5rem rgba(0, 0, 0, 0.06);
}

/* ——— Deep link focus ——— */
.wk-cat-item--focused {
  animation: wk-focus-glow 2.4s var(--ease);
}

@keyframes wk-focus-glow {
  0%,
  100% {
    opacity: 1;
  }
  20% {
    opacity: 0.92;
  }
}

.wk-cat-item--focused .wk-cat-item-media {
  box-shadow: 0 0 0 1px rgba(26, 26, 26, 0.12);
}

/* ——— The Deer story experience ——— */
.wk-story {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.wk-story-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  background: none;
  border: none;
  border-bottom: 1px solid rgba(26, 26, 26, 0.35);
  padding: 0 0 2px;
  cursor: pointer;
  transition: opacity 0.35s ease;
}

.wk-story-toggle:hover {
  opacity: 0.72;
}

.wk-story-toggle-icon {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.45s var(--ease);
}

.wk-story.is-open .wk-story-toggle-icon {
  transform: rotate(-135deg) translateY(1px);
}

.wk-story-panel {
  margin-top: 1.75rem;
  max-width: 28rem;
}

.wk-story-panel[hidden] {
  display: none !important;
}

.wk-story-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 0.85rem;
}

.wk-story-section-fig {
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 2px;
  background: #dedbd6;
  line-height: 0;
}

.wk-story-section-fig img {
  width: 100%;
  height: auto;
  display: block;
}

.wk-story-section-text {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-soft);
  margin-bottom: 0;
}

.wk-story-divider {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: clamp(1.75rem, 4vw, 2.25rem) 0;
}

@media (prefers-reduced-motion: reduce) {
  .wk-cat-item--focused {
    animation: none;
  }
}
