.expertise {
  --expertise-pin: 112px;
  --expertise-intro-height: 180px;
  --expertise-step: 14px;
  --expertise-depth: 126px;
  --expertise-hold: clamp(240px, 55svh, 480px);
  --expertise-card-height: clamp(260px, calc(100svh - var(--expertise-pin) - var(--expertise-intro-height) - var(--expertise-depth) - 24px), 480px);
  padding: clamp(64px, 9svh, 112px) 20px 80px;
  background: #0b0b0b;
  color: #f8f6f4;
  scroll-margin-top: 100px;
  overflow-x: clip;
}
.expertise-inner { width: min(1600px, 100%); margin: 0 auto; }
.expertise-kicker { margin: 0 0 22px; color: #b7b2ac; font-size: 11px; letter-spacing: .12em; }
.expertise-intro {
  position: sticky;
  top: var(--expertise-pin);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(20px, 2.5vw, 32px);
  padding: 0 0 clamp(30px, 4vw, 48px);
  background: #0b0b0b;
}
.expertise-intro h2 {
  margin: 0 0 0 -.035em;
  font-size: clamp(52px, 7.8vw, 112px);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.075em;
  text-wrap: balance;
}
.expertise-intro p {
  max-width: 880px;
  margin: 0;
  font-size: clamp(21px, 2.9vw, 38px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.045em;
}
.expertise-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 6.25vw, 90px);
}
/* Keep the final card inside its sticky container while it docks and rebounds. */
.expertise-stack::after {
  content: '';
  display: block;
  flex: 0 0 var(--expertise-hold);
  pointer-events: none;
}
.expertise-card {
  position: sticky;
  top: calc(var(--expertise-pin) + var(--expertise-intro-height) + var(--stack-index, 0) * var(--expertise-step));
  z-index: 2;
  flex: 0 0 auto;
  min-height: var(--expertise-card-height);
  margin: 0;
}
.expertise-card-surface {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: var(--expertise-card-height);
  padding: clamp(28px, 4vw, 64px);
  overflow: hidden;
  border-radius: 20px;
  background: #f8f6f2;
  color: #0b0b0b;
  text-align: left;
  isolation: isolate;
  transform-origin: center;
}
.expertise-card-surface::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: #0b0b0b;
  opacity: var(--stack-dim, 0);
  pointer-events: none;
}
.expertise-index {
  display: block;
  margin-bottom: clamp(18px, 2vw, 28px);
  color: #b5631b;
  font-size: clamp(30px, 3.5vw, 50px);
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.06em;
}
.expertise-card h3 {
  max-width: 16em;
  margin: 0;
  font-size: clamp(38px, 6.5vw, 96px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.065em;
  text-wrap: balance;
}
.expertise-card p {
  max-width: 38em;
  margin: auto 0 0;
  padding-top: 26px;
  font-size: clamp(18px, 2vw, 27px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.025em;
}
@media(max-width: 760px) {
  .expertise {
    --expertise-pin: 132px;
    --expertise-step: 6px;
    --expertise-depth: 54px;
    padding: 56px 16px 56px;
    scroll-margin-top: 140px;
  }
  .expertise-intro { gap: 20px; padding-bottom: 28px; }
  .expertise-intro h2 { max-width: 10em; font-size: clamp(44px, 10.5vw, 72px); }
  .expertise-intro p { max-width: 24em; font-size: clamp(20px, 4.7vw, 28px); }
  .expertise-stack { gap: 48px; }
  .expertise-card-surface { padding: 28px 24px; border-radius: 16px; }
  .expertise-card h3 { font-size: clamp(34px, 8.7vw, 62px); }
  .expertise-card p { font-size: 18px; padding-top: 24px; }
}
/* Give the cards the viewport when there is no room to pin both heading and card. */
@media(max-height: 600px), (max-width: 760px) and (max-height: 640px) {
  .expertise { --expertise-intro-height: 0px !important; --expertise-card-height: clamp(310px, calc(100svh - var(--expertise-pin) - var(--expertise-depth) - 24px), 480px); }
  .expertise-intro { position: relative; top: auto; }
}
@media(prefers-reduced-motion: reduce) {
  .expertise-intro, .expertise-card { position: relative; top: auto; }
  .expertise-card-surface::after { display: none; }
  .expertise-stack::after { display: none; }
}
