/* ── Work / case studies ──────────────────────────────────────────── */
/* The section that carries the argument, so it gets the most air. */

#work {
  padding: 140px 8vw 100px;
  background: var(--grey-1);
}

.work-header {
  margin-bottom: 56px;
}

/* ── Featured case study ──────────────────────────────────────────── */
/* Breaks the grid on purpose: one element per viewport gets to be loud. */

.work-featured {
  background: var(--black);
  border-left: 2px solid var(--white);
  padding: 56px 48px;
  margin-bottom: 2px;
}

.work-featured-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--grey-2);
}

.work-featured-id {
  display: flex;
  align-items: center;
  gap: 24px;
}

.work-featured-id img {
  height: 64px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
}

.work-featured-name {
  font-family: var(--font-display);
  font-size: clamp(38px, 4.4vw, 56px);
  color: var(--white);
  letter-spacing: 0.05em;
  line-height: 1;
}

.work-tags {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--grey-3);
  letter-spacing: 0.1em;
  line-height: 1.8;
}

/* Problem → built → changed, side by side. Same three slots in the same
   order on every card, so four case studies read in ten seconds. */
.work-story {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-top: 36px;
}

.work-story p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--grey-4);
  line-height: 1.75;
}

.work-featured .work-story .field-label {
  color: var(--white);
}

/* ── Secondary case studies ───────────────────────────────────────── */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.work-card {
  background: var(--black);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  border-left: 2px solid transparent;
  transition: border-color var(--transition-base);
}

@media (hover: hover) and (pointer: fine) {
  .work-card:hover {
    border-left-color: var(--white);
  }
}

.work-logo {
  height: 52px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.work-logo-placeholder {
  display: block;
  height: 52px;
}

.work-name {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--white);
  margin-top: 20px;
  letter-spacing: 0.05em;
  /* Two lines reserved so a wrapping name doesn't push one card's
     story block out of line with its neighbours. */
  min-height: 2em;
}

.work-card .work-tags {
  margin-top: 6px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--grey-2);
}

.work-card .work-story {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.work-card .work-story p {
  font-size: 12px;
  color: var(--grey-3);
  line-height: 1.7;
}

/* ── The pattern / bridge block ───────────────────────────────────── */
/* The move the visitor is meant to make: "that's us." */

.work-pattern {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--grey-2);
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 56px;
  align-items: start;
}

.work-pattern-heading {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.4vw, 44px);
  color: var(--white);
  letter-spacing: 0.05em;
  line-height: 1.05;
  margin-top: 12px;
}

.work-pattern p {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--grey-4);
  line-height: 1.8;
}

.work-link {
  display: inline-block;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  border-bottom: 1px solid var(--grey-2);
  padding-bottom: 6px;
}

@media (hover: hover) and (pointer: fine) {
  .work-link:hover {
    border-bottom-color: var(--white);
  }
}

/* ── Read more ────────────────────────────────────────────────────── */

.work-featured-cta {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--grey-2);
}

.btn-read-more {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--white);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 15px 26px;
  transition: background-color var(--transition-base),
              color var(--transition-base),
              transform var(--dur-press) var(--ease-out);
}

/* The arrow leads the way out of the page — 4px is a nudge, not a lurch. */
.btn-read-more-arrow {
  display: inline-block;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .btn-read-more:hover {
    background: transparent;
    color: var(--white);
  }
  .btn-read-more:hover .btn-read-more-arrow {
    transform: translateX(4px);
  }
}

.btn-read-more:active {
  transform: scale(0.97);
  transition-duration: 100ms;
}

.work-featured-cta-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--grey-3);
  letter-spacing: 0.05em;
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  .btn-read-more-arrow {
    transition: none;
  }
  .btn-read-more:hover .btn-read-more-arrow {
    transform: none;
  }
  .btn-read-more:active {
    transform: scale(0.99);
  }
}

/* ── Visit the live site ──────────────────────────────────────────── */
/* margin-top: auto pins this to the bottom of the card, so a shorter
   story doesn't leave the link floating mid-card. */

.work-visit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--white);
  transition: color var(--transition-base),
              transform var(--dur-press) var(--ease-out);
}

.work-visit span:first-child {
  border-bottom: 1px solid var(--grey-2);
  padding-bottom: 4px;
  transition: border-color var(--transition-base);
}

/* Up-and-right, not straight right: this link leaves the site, and the
   glyph should not read the same as in-site navigation. */
.work-visit-arrow {
  display: inline-block;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .work-visit:hover span:first-child {
    border-bottom-color: var(--white);
  }
  .work-visit:hover .work-visit-arrow {
    transform: translate(3px, -3px);
  }
}

.work-visit:active {
  transform: scale(0.97);
  transition-duration: 100ms;
}

@media (prefers-reduced-motion: reduce) {
  .work-visit-arrow,
  .work-visit:hover .work-visit-arrow {
    transform: none;
    transition: none;
  }
  .work-visit:active {
    transform: scale(0.99);
  }
}
