/* Work index and case studies */

.work-intro {
  padding-top: clamp(56px, 7vw, 96px);
  padding-bottom: clamp(52px, 6vw, 88px);
  border-bottom: 0;
}

.work-intro-copy {
  max-width: 1120px;
}

.work-intro h1 {
  max-width: 15ch;
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-size: clamp(52px, 8.2vw, 118px);
  font-weight: 600;
  line-height: .94;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.work-intro .sub {
  max-width: 54ch;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.6;
  text-wrap: pretty;
}

.work-catalog {
  padding-top: 22px;
  padding-bottom: 64px;
}

.work-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 32px;
}

.work-count {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-bar button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .16s ease;
}

.filter-bar button:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.filter-bar button:active {
  transform: scale(.97);
}

.filter-bar button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.filter-bar button[aria-pressed="true"] {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.work-projects {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(20px, 2.2vw, 32px);
}

.project-card {
  grid-column: span 6;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: inherit;
  text-decoration: none;
  transition: background .24s ease, border-color .24s ease, transform .24s cubic-bezier(.16, 1, .3, 1);
}

.project-card:nth-child(1),
.project-card:nth-child(4) {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
}

.project-card:hover {
  border-color: color-mix(in oklab, var(--fg) 55%, var(--line));
  background: var(--subtle);
  transform: translateY(-3px);
}

.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--subtle);
}

.project-card:nth-child(1) .project-media,
.project-card:nth-child(4) .project-media {
  min-height: 100%;
  aspect-ratio: auto;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform .7s cubic-bezier(.16, 1, .3, 1);
}

.project-card:hover .project-media img {
  transform: scale(1.018);
}

.project-media-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 280px;
  place-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.project-body {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  padding: clamp(28px, 3.2vw, 48px);
}

.project-card:nth-child(1) .project-body,
.project-card:nth-child(4) .project-body {
  min-height: 480px;
}

.project-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.project-meta span:last-child {
  text-align: right;
}

.project-card h2 {
  margin: clamp(24px, 2.5vw, 36px) 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.project-card:not(:nth-child(1)):not(:nth-child(4)) h2 {
  font-size: clamp(27px, 2.4vw, 36px);
}

.project-summary {
  max-width: 54ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.project-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: auto;
  padding-top: 42px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.project-tag {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .07em;
  line-height: 1.2;
  text-transform: uppercase;
}

.project-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.project-link .arrow,
.next-project .arrow {
  transition: transform .2s ease;
}

.project-card:hover .project-link .arrow,
.next-project:hover .arrow {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: no-preference) {
  .project-card.is-filter-leaving {
    pointer-events: none;
    animation: project-filter-out .15s ease both;
  }

  .project-card.is-filter-entering {
    animation: project-filter-in .52s cubic-bezier(.16, 1, .3, 1) var(--filter-delay, 0ms) both;
  }

  @keyframes project-filter-out {
    to {
      opacity: 0;
      transform: translateY(-7px) scale(.99);
    }
  }

  @keyframes project-filter-in {
    from {
      opacity: 0;
      transform: translateY(18px) scale(.985);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

.work-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 72px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

/* Case study */

.case-hero {
  padding-top: 36px;
  padding-bottom: clamp(84px, 10vw, 144px);
}

.case-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .18s ease, transform .18s ease;
}

.case-back:hover {
  color: var(--fg);
  transform: translateX(-2px);
}

.case-back:focus-visible,
.case-gallery-link:focus-visible,
.next-project:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.case-heading {
  max-width: 1120px;
  margin-top: clamp(52px, 7vw, 92px);
}

.case-kicker {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.case-heading h1 {
  max-width: 1120px;
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 6.2vw, 88px);
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.case-heading .lede {
  max-width: 59ch;
  margin-top: 30px;
  font-size: clamp(18px, 1.45vw, 22px);
  line-height: 1.58;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin: clamp(52px, 7vw, 88px) 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.case-meta-item {
  min-width: 0;
}

.case-meta dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.case-meta dd {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(16px, 1.4vw, 19px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.015em;
}

.case-hero-media {
  margin: clamp(48px, 7vw, 88px) 0 0;
}

.case-screen {
  overflow: hidden;
  padding: clamp(7px, 1.3vw, 16px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--subtle);
}

.case-screen img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  object-fit: cover;
  object-position: top;
}

.case-media-placeholder {
  display: grid;
  min-height: 480px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--subtle);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.case-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  line-height: 1.5;
  text-transform: uppercase;
}

.case-story {
  padding-top: 0;
  padding-bottom: 0;
}

.case-story-section {
  display: grid;
  grid-template-columns: minmax(250px, 4fr) minmax(0, 7fr);
  gap: clamp(48px, 8vw, 120px);
  align-items: start;
  padding: clamp(72px, 9vw, 124px) 0;
  border-top: 1px solid var(--line);
}

.case-story-section h2 {
  max-width: 12ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 4.2vw, 60px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.case-prose {
  max-width: 68ch;
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.72;
}

.case-prose p {
  margin: 0;
}

.case-prose p + p,
.case-prose p + ul,
.case-prose ul + p {
  margin-top: 24px;
}

.case-prose ul,
.case-prose ol {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-prose li {
  position: relative;
  padding-left: 22px;
}

.case-prose li::before {
  content: "";
  position: absolute;
  top: .78em;
  left: 0;
  width: 10px;
  height: 1px;
  background: var(--fg);
}

.case-process-wrap,
.case-gallery-wrap,
.case-next-wrap {
  padding-top: clamp(76px, 9vw, 124px);
  padding-bottom: clamp(76px, 9vw, 124px);
  border-top: 1px solid var(--line);
}

.case-section-heading {
  max-width: 760px;
  margin-bottom: clamp(38px, 5vw, 64px);
}

.case-section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 68px);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.case-section-heading p {
  max-width: 55ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.case-process {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.case-process-step {
  min-height: 220px;
  padding: clamp(26px, 3vw, 42px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.case-process-step h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.3vw, 31px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.case-process-step p {
  max-width: 46ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.case-gallery {
  display: grid;
  gap: clamp(48px, 7vw, 96px);
}

.case-gallery-item {
  margin: 0;
}

.case-gallery-image {
  overflow: hidden;
  padding: clamp(7px, 1.3vw, 16px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--subtle);
}

.case-gallery-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.case-capture-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.case-capture-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.5vw, 34px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.case-gallery-link {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .07em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-transform: uppercase;
}

.case-gallery-link:hover {
  color: var(--fg);
}

.case-fullpage-frame {
  height: 720px;
  height: clamp(520px, 72dvh, 820px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(7px, 1.3vw, 16px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--subtle);
  scrollbar-color: var(--muted) transparent;
  scrollbar-width: thin;
}

.case-fullpage-frame:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.case-fullpage-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.next-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: end;
  padding: clamp(34px, 5vw, 68px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--subtle);
  transition: border-color .2s ease, transform .2s cubic-bezier(.16, 1, .3, 1);
}

.next-project:hover {
  border-color: color-mix(in oklab, var(--fg) 55%, var(--line));
  transform: translateY(-2px);
}

.next-project-meta {
  margin: 0 0 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.next-project h2 {
  max-width: 18ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.8vw, 68px);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.next-project .arrow {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .project-card,
  .project-card:nth-child(1),
  .project-card:nth-child(4) {
    grid-column: span 6;
    display: block;
  }

  .project-card:nth-child(1) .project-media,
  .project-card:nth-child(4) .project-media {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .project-card:nth-child(1) .project-body,
  .project-card:nth-child(4) .project-body {
    min-height: 340px;
  }

  .case-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 32px;
  }

  .case-story-section {
    grid-template-columns: minmax(210px, 4fr) minmax(0, 7fr);
    gap: 48px;
  }
}

@media (max-width: 720px) {
  .work-intro {
    padding-top: 48px;
    padding-bottom: 68px;
  }

  .work-intro h1 {
    font-size: clamp(48px, 15vw, 68px);
  }

  .work-toolbar {
    display: block;
  }

  .filter-bar {
    justify-content: flex-start;
    margin-top: 20px;
  }

  .filter-bar button {
    min-height: 40px;
  }

  .work-projects {
    grid-template-columns: 1fr;
  }

  .project-card,
  .project-card:nth-child(1),
  .project-card:nth-child(4) {
    grid-column: auto;
  }

  .project-body,
  .project-card:nth-child(1) .project-body,
  .project-card:nth-child(4) .project-body {
    min-height: 0;
    padding: 26px;
  }

  .project-card h2,
  .project-card:not(:nth-child(1)):not(:nth-child(4)) h2 {
    font-size: clamp(28px, 9vw, 38px);
  }

  .project-footer {
    display: block;
    padding-top: 32px;
  }

  .project-link {
    margin-top: 28px;
  }

  .case-hero {
    padding-top: 28px;
    padding-bottom: 76px;
  }

  .case-heading {
    margin-top: 48px;
  }

  .case-heading h1 {
    font-size: clamp(42px, 11.5vw, 56px);
    line-height: .98;
  }

  .case-heading .lede {
    font-size: 17px;
  }

  .case-meta {
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
  }

  .case-media-placeholder {
    min-height: 260px;
  }

  .case-caption {
    display: block;
  }

  .case-caption span + span {
    display: block;
    margin-top: 5px;
  }

  .case-story-section {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 68px 0;
  }

  .case-story-section h2 {
    max-width: 15ch;
  }

  .case-process {
    grid-template-columns: 1fr;
  }

  .case-process-step {
    min-height: 0;
  }

  .case-capture-head {
    display: block;
  }

  .case-gallery-link {
    display: inline-block;
    margin-top: 12px;
  }

  .case-fullpage-frame {
    height: 64dvh;
    min-height: 460px;
  }

  .next-project {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 30px;
  }

  .next-project .arrow {
    font-size: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-card,
  .project-media img,
  .project-link .arrow,
  .next-project,
  .next-project .arrow {
    transition: none;
  }
}

/* Case studies use quiet bands and framed moments instead of stacked rules. */
.case-story-section,
.case-process-wrap,
.case-gallery-wrap,
.case-next-wrap {
  border-top: 0;
}

.case-story-section + .case-story-section {
  padding-top: clamp(40px, 6vw, 84px);
}

.case-process-wrap {
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  background: var(--subtle);
}

.case-gallery-wrap {
  padding-top: clamp(60px, 8vw, 104px);
}

.case-next-wrap {
  padding-top: clamp(56px, 7vw, 96px);
}
