/* --- Portrait ------------------------------------------------------- */
.portrait {
  position: relative;
  width: 96px;
  height: 96px;
  padding: 4px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--pine);
  opacity: .55;
}

.portrait img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--pine);
  font-weight: 600;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pine);
  box-shadow: 0 0 0 3px var(--pine-wash);
}

/* --- The card stack ------------------------------------------------- */
/* Each link is dealt at a slight angle and squares up when you reach it. */
.card {
  --tilt: 0deg;
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr 20px;
  align-items: center;
  gap: .9rem;
  min-height: 68px;
  padding: .85rem 1.1rem .85rem .95rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  rotate: var(--tilt);
  transition:
    rotate .28s var(--ease),
    translate .28s var(--ease),
    box-shadow .28s var(--ease),
    border-color .28s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 3px;
  background: var(--pine);
  scale: 1 0;
  transition: scale .28s var(--ease);
}

.card:hover,
.card:focus-visible {
  rotate: 0deg;
  translate: 0 -2px;
  border-color: var(--rule-strong);
  box-shadow: var(--shadow-lift);
}

.card:hover::before,
.card:focus-visible::before {
  scale: 1 1;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--pine-wash);
  color: var(--pine);
}

.card-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -.01em;
}

.card-sub {
  display: block;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.35;
}

.card-arrow {
  color: var(--muted);
  transition: translate .28s var(--ease), color .28s var(--ease);
}

.card-arrow svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card:hover .card-arrow,
.card:focus-visible .card-arrow {
  translate: 3px 0;
  color: var(--pine);
}

/* The lead card carries the one action worth prioritising. */
.card-lead {
  background: var(--pine);
  border-color: transparent;
  color: var(--on-pine);
}

.card-lead .card-icon {
  background: var(--on-pine-wash);
  color: var(--on-pine);
}

.card-lead .card-sub,
.card-lead .card-arrow {
  color: var(--on-pine-dim);
}

.card-lead::before {
  background: var(--on-pine);
}

.card-lead:hover .card-arrow,
.card-lead:focus-visible .card-arrow {
  color: var(--on-pine);
}

/* --- Social rail ---------------------------------------------------- */
.social {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  transition: color .2s var(--ease), border-color .2s var(--ease), translate .2s var(--ease);
}

.social svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social:hover,
.social:focus-visible {
  color: var(--pine);
  border-color: var(--pine);
  translate: 0 -2px;
}

/* --- Chips ---------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 36px;
  padding: 0 .85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}

.chip svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chip:hover,
.chip:focus-visible {
  color: var(--ink);
  border-color: var(--rule-strong);
  background: var(--surface);
}

.chip[data-state="done"] {
  color: var(--pine);
  border-color: var(--pine);
}

/* --- Deal-in ---------------------------------------------------------
   Cards arrive as if dealt from a hand, then settle into their tilt. */
@keyframes deal {
  from {
    opacity: 0;
    translate: 0 12px;
    rotate: calc(var(--tilt) * 4);
  }
}

.card {
  animation: deal .5s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 65ms + 120ms);
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card-arrow,
  .social,
  .chip {
    transition: none;
  }

  .card {
    rotate: 0deg;
    animation: none;
  }

  .card:hover,
  .card:focus-visible {
    translate: none;
  }
}
