/* Homepage testimonials: a stack of chat-notification cards that arrive one
   after another as the visitor scrolls. Loaded after grok-skin.css.
   The anatomy follows a chat app's notification (icon tile, bold sender, muted
   second line, message text); the colours and type are Loopdash's own. */

.notif-heading {
  margin: 0 0 clamp(1.5rem, 3vw, 2.25rem);
  text-align: center;
  font-size: clamp(1.625rem, 3.2vw, 2.5rem);
  font-weight: 500;
  letter-spacing: var(--track-display);
  line-height: 1.1;
  color: var(--gray-900);
}

.notif-stack {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.625rem;
  max-width: 34rem;
}
.notif { margin: 0; padding: 0; }
.notif::before { content: none; }

.notif__card {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  -moz-column-gap: 0.875rem;
       column-gap: 0.875rem;
  margin: 0;
  padding: 1.125rem 1.375rem 1.25rem 1.125rem;
  background: #fff;
  border-radius: 22px;
  box-shadow:
    0 0 0 1px rgba(34, 31, 26, 0.05),
    0 1px 2px rgba(34, 31, 26, 0.05),
    0 12px 28px -14px rgba(34, 31, 26, 0.22);
}

/* Sender tile: the person's photo when the testimonial has one (front matter
   `photo`), otherwise a default silhouette. The app mark sits on its corner, the way
   a phone shows who a chat notification is from. */
.notif__icon {
  grid-row: 1 / span 2;
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: 0.125rem;
}
.notif__photo,
.notif__default {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 10px;
}
.notif__photo { -o-object-fit: cover; object-fit: cover; background: var(--gray-200); }
/* No photo: the plain silhouette a chat app shows for a member without one,
   in a handful of its stock colours so neighbouring cards differ. */
.notif__default { background: #44bedf; fill: #f1f9fd; }
.notif:nth-child(4n + 1) .notif__default { background: #e8a23b; fill: #fdf6ea; }
.notif:nth-child(4n + 2) .notif__default { background: #8f6fb5; fill: #f5f0fa; }
.notif:nth-child(4n + 3) .notif__default { background: #5fae7b; fill: #eff8f2; }
.notif__badge {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(34, 31, 26, 0.08), 0 1px 2px rgba(34, 31, 26, 0.12);
}
.notif__badge svg { display: block; }

.notif__head {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
}
.notif__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.notif__time {
  flex: none;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--gray-700);
}
.notif__name {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--gray-900);
}
.notif__meta {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--gray-700);
}

.home-reviews .notif__body {
  grid-column: 2;
  margin: 0.3rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.9375rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.47;
  color: var(--gray-900);
  quotes: none;
}
.home-reviews .notif__body::before,
.home-reviews .notif__body::after { content: none; }

/* ---------- Scroll-driven stack ----------
   Opt-in from the script (.is-stacked), so no-JS and reduced-motion visitors
   keep the plain list above. The track is tall; the stage sticks to the screen
   while the script moves cards through the stack from the scroll position.
   Each <li> is the visible card surface so it can be resized to match the card
   in front while it sits behind it. */

/* position: sticky needs <main> not to be a scroll container (base.css sets
   overflow: hidden). Clip sideways only, as the blog and about pages do. */
main:has(.notif-scroll) { overflow-x: clip; overflow-y: visible; }

.notif-scroll.is-stacked {
  height: calc(100svh + (var(--notif-count, 7) - 1) * 36vh);
}
/* Snap points, one per card (placed by the script). `proximity` leaves the rest
   of the page scrolling freely; `stop: always` keeps a fast flick from skipping
   cards. */
html:has(.notif-scroll.is-stacked) { scroll-snap-type: y proximity; }
.notif-scroll.is-stacked { position: relative; }
.notif-snap {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.notif-scroll.is-stacked .notif-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  align-content: center;
  padding-top: var(--bar-height, 3.5rem);
  box-sizing: border-box;
}
.notif-scroll.is-stacked .notif-stack {
  display: block;
  position: relative;
  width: 100%;
}
.notif-scroll.is-stacked .notif {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  visibility: hidden;
  background: #fff;
  border-radius: 22px;
  box-shadow:
    0 0 0 1px rgba(34, 31, 26, 0.05),
    0 1px 2px rgba(34, 31, 26, 0.05),
    0 14px 30px -14px rgba(34, 31, 26, 0.28);
  will-change: transform, opacity;
}
.notif-scroll.is-stacked .notif__card {
  background: none;
  box-shadow: none;
  border-radius: 0;
}
/* The section's own padding would sit above and below a full-screen stage. */
.home-reviews:has(.notif-scroll.is-stacked) { padding-top: 0; padding-bottom: 0; }
