/* The slots share a baseline. The negative margins account for the extra
   space that opens between the upper corners when the cards rotate. */
.process-fan {
  --fan-ease: cubic-bezier(.22, 1, .36, 1);
  padding: clamp(72px, 7.5vw, 124px) 0 clamp(78px, 8vw, 132px);
  border-block: 1px solid var(--edge);
}

.process-intro { text-align: start; }
.process-intro .eyebrow { margin: 0 0 16px; }
.process-intro h2 {
  margin: 0;
  font-size: clamp(2.5rem, 4.8vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -.055em;
}
.process-intro .process-summary {
  max-width: 52ch;
  margin: 20px 0 0;
  color: var(--soft);
  font-size: 1.05rem;
  line-height: 1.55;
}
.process-deck {
  display: flex;
  justify-content: center;
  isolation: isolate;
  margin: clamp(72px, 7vw, 106px) auto 0;
  padding: 0;
  list-style: none;
}
.process-slot {
  --angle: -8deg;
  --gather: 65%;
  --drift: -5px;
  --offset: 12px;
  --stock: #e5edf1;
  --ink: #112e44;
  --detail: #246482;
  position: relative;
  display: flex;
  width: min(22vw, calc((100% - 2 * var(--spread, 0px) - 116px) / 4), 332px);
  flex: none;
  transform: translateY(var(--offset));
}
.process-slot:nth-child(2) {
  --angle: -2deg;
  --gather: 22%;
  --offset: 0px;
  --drift: -2px;
  --stock: #13334b;
  --ink: #f3f6f6;
  --detail: #9ad9e9;
  margin-inline-start: -44px;
}
.process-slot:nth-child(3) {
  --angle: 1deg;
  --gather: -22%;
  --offset: 0px;
  --drift: 2px;
  --stock: #fcab72;
  --ink: #30221d;
  --detail: #6b3722;
  margin-inline-start: -34px;
}
.process-slot:nth-child(4) {
  --angle: 8deg;
  --gather: -65%;
  --drift: 5px;
  --stock: #192d42;
  --ink: #f3f6f6;
  --detail: #ffb584;
  margin-inline-start: -48px;
}
.process-card {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: 100%;
  min-height: clamp(400px, 31vw, 448px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: clamp(28px, 2.3vw, 34px);
  color: var(--ink);
  background: var(--stock);
  border: 1px solid color-mix(in srgb, var(--detail) 35%, var(--stock));
  border-radius: 7px;
  box-shadow: 0 10px 22px -10px #030c1780;
  transform-origin: center bottom;
  transform: rotate(var(--angle));
  transition: transform 520ms var(--fan-ease), box-shadow 520ms var(--fan-ease);
}
.process-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(ellipse at var(--shine-x, 50%) var(--shine-y, 25%),
    #bdeeff2b, transparent 55%);
  box-shadow: inset 0 1px 0 #cef4ff85, inset 0 -1px 0 #ffa56e70;
  transition: opacity 350ms ease;
}
.process-number {
  display: block;
  color: var(--detail);
  margin-bottom: 12px;
  font: 600 .8rem/1 ui-monospace, monospace;
  letter-spacing: .12em;
}
.process-card h3 {
  margin: 0;
  color: inherit;
  font-size: clamp(1.65rem, 2.4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -.055em;
  line-height: 1.04;
}
.process-icon {
  align-self: center;
  justify-self: center;
  width: min(76%, 160px);
  height: auto;
  fill: none;
  stroke: var(--detail);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.process-icon .draft { opacity: .45; stroke-width: 1; stroke-dasharray: 2 5; }
.process-icon .ink { fill: var(--detail); fill-opacity: .18; }
.process-card p {
  margin: 0;
  padding-right: 12px;
  color: inherit;
  font-size: 1rem;
  line-height: 1.48;
}
.process-card:focus-visible {
  outline: 3px solid var(--detail);
  outline-offset: -7px;
}
.process-slot[data-pose="active"] { z-index: 7; }
.process-slot[data-pose="active"] .process-card::before { opacity: 1; }
.process-slot[data-pose="active"] .process-card {
  box-shadow: 0 18px 38px -14px #02091496, 0 0 22px -5px #63ccf187, 0 2px 7px -3px #ffb07888;
}
@media (min-width: 1051px) and (prefers-reduced-motion: no-preference) {
  .process-deck { --spread: clamp(62px, calc(14vw - 124px), 88px); }
  .process-slot:nth-child(1), .process-slot:nth-child(4) { --lean: 13deg; }
  .process-slot:nth-child(2), .process-slot:nth-child(3) { --lean: 7deg; }
  .process-slot[data-pose="before"] .process-card {
    transform: translate(calc(-1 * var(--spread)), 9px) rotate(calc(-1 * var(--lean)));
  }
  .process-slot[data-pose="after"] .process-card {
    transform: translate(var(--spread), 9px) rotate(var(--lean));
  }
  .process-slot[data-pose="active"] .process-card {
    transform: translateY(-22px) rotate(0deg) scale(1.018);
  }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .process-icon { transition: translate 180ms ease-out; }
  .process-slot[data-pose="active"] .process-icon {
    translate: calc((var(--shine-x, 50%) - 50%) * .09) calc((var(--shine-y, 50%) - 50%) * .09);
  }
}
@media (max-width: 1050px) {
  .process-deck {
    max-width: 760px;
    width: 88%;
    flex-wrap: wrap;
    gap: 42px 20px;
  }
  .process-deck .process-slot {
    --offset: 0px;
    --gather: 8%;
    --angle: -2deg;
    width: calc(50% - 10px);
    margin: 0;
  }
  .process-deck .process-slot:nth-child(even) { --angle: 2deg; --gather: -8%; }
  .process-card { min-height: 350px; }
}
@media (max-width: 600px) {
  .process-deck { max-width: 380px; width: calc(100% - 48px); gap: 22px; margin-top: 48px; }
  .process-deck .process-slot:nth-child(n) { width: 100%; --angle: 0deg; --gather: 0%; }
  .process-card { min-height: 310px; padding: 26px; }
  .process-icon { width: 108px; }
  .process-card:focus-visible { transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .process-intro.fan-pending { opacity: 0; transform: translateY(14px); }
  .process-intro.fan-ready { transition: opacity 650ms ease, transform 650ms var(--fan-ease); }
  .process-deck.fan-pending .process-slot {
    opacity: 0;
    transform: translate(var(--gather), 32px);
  }
  .process-deck.fan-pending .process-card { transform: rotate(0deg); }
  .process-deck.fan-ready .process-slot {
    transition: opacity 750ms ease, transform 1200ms var(--fan-ease);
  }
  .process-deck.fan-opening .process-card { transition-duration: 1200ms; }
}
@media (min-width: 1051px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .process-deck { view-timeline-name: --process-travel; }
    .process-slot {
      animation: process-drift linear both;
      animation-timeline: --process-travel;
      animation-range: entry 50% cover 70%;
    }
    @keyframes process-drift { from { translate: 0; } to { translate: var(--drift) 0; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  .process-card, .process-card::before {
    transition: none;
  }
}
@media print {
  .process-fan .process-intro, .process-fan .process-slot { opacity: 1; transform: none; }
  .process-deck { flex-wrap: wrap; gap: 1rem; }
  .process-deck .process-slot { width: 46%; margin: 0; break-inside: avoid; }
  .process-fan .process-card { transform: none; }
}
