/* HOME: KIND WORDS, the Sticky Deck.
   Six testimonial notes dealt like a hand of cards. Click one to bring it forward.
   Mobile first (a vertical cascade), fanned left to right from 900px.
   Reference: Testimonial2c-StickyDeck(-Mobile) in the layout comps artifact. */

.kw {
  font-family: 'DM Sans', sans-serif;
  color: #050505;
  background: #fffefb;
  padding: 48px 0 0;
  scroll-margin-top: 72px;
  overflow: hidden;
}
.kw *, .kw *::before, .kw *::after { box-sizing: border-box; }
.kw-head { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.kw .section-header { margin-bottom: 0; }

/* Pattern field: starts under the divider, ends at the section's bottom edge. */
.kw-field {
  position: relative;
  margin-top: 24px;
  padding: 40px 16px 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 0 L40 0 L0 40 Z' fill='none' stroke='rgba(83,158,150,0.16)' stroke-width='1'/%3E%3Cpath d='M40 0 L40 40 L0 40 Z' fill='none' stroke='rgba(83,158,150,0.16)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 40px 40px;
}

/* Mobile: notes cascade down, each covering most of the one above. */
.kw-deck {
  --w: clamp(240px, 68%, 320px);
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.kw-deck li { position: relative; }
.kw-deck li + li { margin-top: calc(var(--w) * -0.315); } /* each note covers ~38% of the one above, so every note keeps a tappable strip */

.kw-note {
  --rot: 0deg;
  --dx: 0px;
  --dy: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: var(--w);
  min-height: 44px;
  aspect-ratio: 258 / 214;
  margin: 0 auto;
  padding: 20px 20px 18px;
  border: 0;
  border-radius: 0; /* square, like a real sticky note */
  font: inherit;
  text-align: left;
  color: #050505;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(5,5,5,0.16), 0 2px 4px rgba(5,5,5,0.10);
  transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
  transition: transform .22s ease, box-shadow .22s ease;
}
.kw-note::after {
  content: '';
  position: absolute; right: 0; bottom: 0; width: 0; height: 0;
  border-style: solid;
  border-width: 0 0 20px 20px;
  border-color: transparent transparent rgba(5,5,5,0.14) transparent;
}
.kw-note:hover { box-shadow: 0 14px 26px rgba(5,5,5,0.22), 0 3px 7px rgba(5,5,5,0.12); }
.kw-note:focus-visible { outline: 2px solid #2f6a62; outline-offset: 4px; }
.kw-note.is-lifted {
  transform: translate(var(--dx), calc(var(--dy) - 16px)) rotate(0deg) scale(1.05);
  box-shadow: 0 20px 34px rgba(5,5,5,0.26);
}

.kw-quote {
  display: block;
  margin-bottom: 10px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300; font-style: italic;
  font-size: 15px; line-height: 1.36;
}
.kw-rule { display: block; width: 20px; height: 1px; background: #050505; margin-bottom: 5px; }
.kw-name { display: block; font-weight: 700; font-size: 11px; }
.kw-title { display: block; font-weight: 500; font-size: 10px; color: #4b4b4b; }

.kw-pink { background: #ffdfe8; }
.kw-teal { background: #eaf4f3; }
.kw-yellow { background: #fffbe0; }

/* Mobile offsets and tilt, alternating. */
.kw-deck li:nth-child(1) .kw-note { --dx: -6%; --rot: -7deg; }
.kw-deck li:nth-child(2) .kw-note { --dx: 6%;  --rot: 5deg; }
.kw-deck li:nth-child(3) .kw-note { --dx: -8%; --rot: -4deg; }
.kw-deck li:nth-child(4) .kw-note { --dx: 8%;  --rot: 6deg; }
.kw-deck li:nth-child(5) .kw-note { --dx: -7%; --rot: -5deg; }
.kw-deck li:nth-child(6) .kw-note { --dx: 6%;  --rot: 4deg; }

.kw .kw-hint { margin: 80px 0 0; }

/* Deal-in. Notes hide only once the script is ready to deal them. */
.kw.is-waiting .kw-note { opacity: 0; }
.kw.is-dealing .kw-note {
  animation: kwDealM .5s cubic-bezier(.25,.8,.3,1.1) both;
  animation-delay: calc(var(--i) * 0.18s);
}
@keyframes kwDealM {
  0% { opacity: 0; transform: translate(var(--dx), -200px) rotate(-18deg) scale(.85); }
  70% { opacity: 1; transform: translate(var(--dx), calc(var(--dy) + 8px)) rotate(calc(var(--rot) - 2deg)) scale(1.02); }
  100% { opacity: 1; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); }
}

/* Desktop: fanned like a dealt hand across the full width. */
@media (min-width: 900px) {
  .kw { padding-top: 88px; }
  .kw-head { padding: 0 2rem; }
  .kw-field { margin-top: 32px; padding: 72px 2rem 64px; background-size: 56px 56px; }
  .kw-field { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M0 0 L56 0 L0 56 Z' fill='none' stroke='rgba(83,158,150,0.16)' stroke-width='1'/%3E%3Cpath d='M56 0 L56 56 L0 56 Z' fill='none' stroke='rgba(83,158,150,0.16)' stroke-width='1'/%3E%3C/svg%3E"); }
  .kw-deck {
    --w: clamp(220px, 21%, 300px);
    display: flex;
    align-items: flex-start;
    padding: 0 3%;
  }
  /* Six notes share the row: each overlaps the last by whatever the width leaves over. */
  .kw-deck li { flex: 0 0 var(--w); width: var(--w); }
  .kw-deck li .kw-note { width: 100%; }
  .kw-deck li + li { margin-top: 0; margin-left: calc((100% - 6 * var(--w)) / 5); }
  .kw-note {
    aspect-ratio: 300 / 270;
    padding: 26px 24px;
    box-shadow: 0 10px 22px rgba(5,5,5,0.16), 0 2px 5px rgba(5,5,5,0.10);
  }
  .kw-note::after { border-width: 0 0 26px 26px; }
  .kw-note:hover { box-shadow: 0 16px 30px rgba(5,5,5,0.22), 0 3px 7px rgba(5,5,5,0.12); }
  .kw-note.is-lifted {
    transform: translate(var(--dx), calc(var(--dy) - 22px)) rotate(0deg) scale(1.04);
    box-shadow: 0 26px 44px rgba(5,5,5,0.26);
  }
  .kw-quote { font-size: clamp(15px, 1.15vw, 16.5px); line-height: 1.4; margin-bottom: 14px; }
  .kw-rule { width: 24px; margin-bottom: 6px; }
  .kw-name { font-size: 11.5px; }

  .kw-deck li:nth-child(1) .kw-note { --dx: 0px; --dy: 40px; --rot: -10deg; }
  .kw-deck li:nth-child(2) .kw-note { --dx: 0px; --dy: 10px; --rot: -6deg; }
  .kw-deck li:nth-child(3) .kw-note { --dx: 0px; --dy: 35px; --rot: -2deg; }
  .kw-deck li:nth-child(4) .kw-note { --dx: 0px; --dy: 5px;  --rot: 2deg; }
  .kw-deck li:nth-child(5) .kw-note { --dx: 0px; --dy: 30px; --rot: 6deg; }
  .kw-deck li:nth-child(6) .kw-note { --dx: 0px; --dy: 0px;  --rot: 10deg; }

  .kw .kw-hint { margin-top: 104px; }

  .kw.is-dealing .kw-note { animation-name: kwDeal; animation-duration: .55s; }
  @keyframes kwDeal {
    0% { opacity: 0; transform: translate(420px, -40px) rotate(28deg) scale(.85); }
    70% { opacity: 1; transform: translate(-10px, var(--dy)) rotate(calc(var(--rot) - 3deg)) scale(1.02); }
    100% { opacity: 1; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .kw.is-waiting .kw-note { opacity: 1; }
  .kw.is-dealing .kw-note { animation: none; }
  .kw-note { transition: none; }
  .kw .kw-hint { transition: none; }
}
