/* "The human behind the numbers": same layout as the archive invitation, with envelopes instead of folders. */
.human-side { position: relative; z-index: 5; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
  padding: 72px max(5vw, 24px) 96px; background: var(--cream-dk); overflow: hidden; }
.human-side h2 { font-family: var(--display); font-weight: 600; font-size: clamp(48px, 6vw, 80px); line-height: .95; margin: 20px 0; letter-spacing: -.02em; }
.human-side-copy > p:not(.section-label):not(.human-hint) { max-width: 42ch; line-height: 1.7; font-size: 15px; }
.human-hint { display: inline-flex; gap: 32px; align-items: center; margin-top: 28px; padding-bottom: 10px; border-bottom: 1px solid currentColor;
  color: var(--blue); font-size: 13px; font-weight: 600; }

/* Envelopes: a smaller, overlapping, scattered stack */
.letter-stack { list-style: none; display: flex; justify-content: center; align-items: flex-start; padding: 30px 0 40px; }
.letter { --env: #a9c1d6; --env-dk: #95b0c8; --seal: var(--blue); --ink: #ffffff; --rot: -6deg;
  position: relative; flex: 0 0 auto; width: 205px; margin-left: -62px; }
.letter:first-child { margin-left: 0; }
.letter:nth-child(2) { --env: #2f5b8a; --env-dk: #284e78; --seal: var(--accent); --ink: var(--navy); --rot: 4deg; margin-top: 46px; }
.letter:nth-child(3) { --rot: -2deg; margin-top: 8px; }
.letter:nth-child(4) { --env: #2f5b8a; --env-dk: #284e78; --seal: var(--accent); --ink: var(--navy); --rot: 7deg; margin-top: 52px; }
.letter:hover, .letter:focus-within { z-index: 5; }
.letter a { position: relative; display: block; height: 180px; color: var(--navy); text-decoration: none; isolation: isolate;
  transform: perspective(900px) rotate(var(--rot)) translateY(var(--lift, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.letter-back, .letter-front { position: absolute; left: 0; right: 0; top: 56px; bottom: 0; border-radius: 4px; }
.letter-back { z-index: 0; background: var(--env-dk); box-shadow: 0 16px 30px -14px rgba(23,44,70,.5); }
.letter-back::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 50px; background: var(--env-dk);
  clip-path: polygon(0 100%, 50% 0, 100% 100%); filter: brightness(1.04); }
.letter-card { position: absolute; z-index: 1; left: 8%; right: 8%; top: 22px; height: 130px; padding: 13px 13px 0; border-radius: 3px;
  background: #ffffff; box-shadow: 0 2px 10px rgba(23,44,70,.12); display: flex; flex-direction: column; gap: 3px;
  transition: transform .55s cubic-bezier(.2,.8,.2,1); }
.letter-card small { font-size: 8.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.letter-card strong { font-family: var(--display); font-weight: 600; font-size: 23px; line-height: 1; letter-spacing: -.02em; }
.letter-card em { font-style: normal; font-size: 10.5px; line-height: 1.35; opacity: .75; }
.letter-card b { position: absolute; right: 12px; top: 9px; font-size: 16px; font-weight: 400; color: var(--blue); transition: transform .25s ease; }
.letter-front { z-index: 2; background: var(--env); clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 0 100%); }
.letter-front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(0,0,0,.06)); }

/* Little seal on each envelope: paw, heart, note, plane */
.letter-seal { position: absolute; z-index: 3; left: 50%; top: calc(56px + (100% - 56px) / 2); width: 38px; height: 38px; margin: -19px 0 0 -19px;
  display: grid; place-items: center; border-radius: 50%; background: var(--seal); color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--seal) 35%, transparent), 0 4px 10px rgba(14,30,61,.3);
  transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.letter-seal svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.letter:nth-child(1) .letter-seal svg, .letter:nth-child(2) .letter-seal svg { fill: currentColor; stroke-width: 2; }

/* Hover / focus: the envelope straightens and lifts, the card slides out, the seal pops */
.letter a:hover, .letter a:focus-visible { --rot: 0deg; --lift: -10px; outline: none; }
.letter a:hover .letter-card, .letter a:focus-visible .letter-card { transform: translateY(-42px) rotate(-1.5deg); }
.letter a:hover .letter-card b { transform: translate(3px, -3px); }
.letter a:hover .letter-seal, .letter a:focus-visible .letter-seal { transform: scale(1.15) rotate(-12deg); }
.letter a:focus-visible .letter-front { box-shadow: inset 0 0 0 3px var(--accent); }
/* Neighbours step aside a little so the hovered envelope reads clearly */
.letter-stack:hover .letter:not(:hover) a { filter: saturate(.8) brightness(.97); }

/* Deal-in when the section scrolls into view (class added by human-cards.js) */
.letter-stack.hc-undealt .letter a { opacity: 0; transform: translateY(60px) rotate(calc(var(--rot) * 3)); }
.letter-stack.hc-dealing .letter a { transition: transform .8s cubic-bezier(.2,.8,.2,1), opacity .6s ease; transition-delay: calc(var(--i) * 110ms); }
.letter-stack.hc-dealing .letter-card { transform: translateY(-18px); transition-delay: calc(var(--i) * 110ms + 450ms); }

@media (max-width: 980px) {
  .human-side { grid-template-columns: 1fr; gap: 24px; padding: 56px 24px 72px; }
}
@media (max-width: 620px) {
  .letter-stack { flex-wrap: wrap; padding: 10px 0 20px; }
  .letter { width: 52%; max-width: 200px; margin-left: -6%; margin-top: 0 !important; margin-bottom: -18px; }
  .letter:nth-child(odd) { margin-left: 0; }
  .letter:nth-child(even) { translate: 0 30px; }
}

.motion-paused .letter a, .motion-paused .letter-card { transition-duration: .01s !important; }
@media (prefers-reduced-motion: reduce) { .letter a, .letter-card { transition-duration: .01s !important; } }
