@keyframes fade-up {
  from { opacity: 0; transform: translateY(1.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll-reveal: script.js toggles [data-reveal-state="visible"] via IntersectionObserver */
[data-reveal] {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

[data-reveal-state="visible"] {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------------
   Journey thread — script.js reveals .msg bubbles cumulatively as
   you scroll through #journey-scroll, and translates #journey-thread
   upward so the newest message stays in view, like a real text
   thread scrolling itself.
   --------------------------------------------------------------- */
#journey-thread {
  transition: transform 0.5s ease;
}

.msg {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.msg-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------------
   Chat bubble tail — a small curl at the bottom corner, like
   iMessage, built from two overlapping pseudo-elements: ::before
   draws the tail's outer curve in the bubble's own color, ::after
   (page-background color) carves the inner curve out of it,
   leaving a crescent that reads as a curling tail. Shared by every
   chat-style bubble on the site (thread messages, prompts, updates)
   so they all read as one consistent shape.
   --------------------------------------------------------------- */
.tail-left,
.tail-right {
  position: relative;
}
.tail-left::before,
.tail-left::after,
.tail-right::before,
.tail-right::after {
  content: "";
  position: absolute;
  bottom: 0;
  height: 1.25rem;
}
.tail-left::before {
  left: -0.5rem;
  width: 1.25rem;
  background-color: inherit;
  border-bottom-right-radius: 0.9375rem;
}
.tail-left::after {
  left: -0.625rem;
  width: 0.625rem;
  background-color: #fff;
  border-bottom-right-radius: 0.625rem;
}
.tail-right::before {
  right: -0.5rem;
  width: 1.25rem;
  background-color: inherit;
  border-bottom-left-radius: 0.9375rem;
}
.tail-right::after {
  right: -0.625rem;
  width: 0.625rem;
  background-color: #fff;
  border-bottom-left-radius: 0.625rem;
}

/* Final beat: the shared gallery takes over the whole phone screen */
#journey-gallery {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

#journey-gallery.gallery-revealed {
  opacity: 1;
}

/* Progress dots hidden for now, keep the elements + JS logic in place */
#journey-dots,
#feature-dots {
  display: none;
}

#journey-dots button,
#feature-dots button {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--color-blush-200, #f1c3b4);
  transition: background 0.3s ease, width 0.3s ease;
  border: none;
  cursor: pointer;
  padding: 0;
}

#journey-dots button.dot-active,
#feature-dots button.dot-active {
  background: var(--color-blush-500, #c47b6c);
  width: 1.5rem;
}

/* ---------------------------------------------------------------
   Feature slides
   --------------------------------------------------------------- */
.feature-slide {
  scroll-snap-align: center;
}

/* ---------------------------------------------------------------
   Mobile feature regions — one tall sticky-pinned region per
   feature (script.js scrubDemo()/scrollProgress()), mirroring the
   hero journey's pin mechanic on the vertical axis instead of
   desktop's shared horizontal track. Text fades in as the region
   is reached; the demo/graphic scrubs frame-by-frame with scroll.
   --------------------------------------------------------------- */
.feature-mobile-region {
  position: relative;
  height: 170vh;
}

.feature-mobile-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 2rem;
}

.feature-mobile-demo {
  margin-top: 2rem;
  transition-delay: 0.35s;
}

.demo {
  position: relative;
  height: 13rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Demos only animate while their slide is in view (script.js toggles .is-playing) */
.demo * {
  animation-play-state: paused;
}

.is-playing .demo * {
  animation-play-state: running;
}

/* --- uploads --- */
.demo-uploads .d-up {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  width: 17rem;
}
.demo-uploads .d-bubble {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--color-blush-500, #c47b6c);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 1.2rem;
  font-size: 1rem;
  opacity: 0;
  transform: translateY(10px);
}
.demo-uploads .d-photo-chip {
  width: 3rem;
  height: 2.1rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.35);
}
.demo-uploads .d-up-photo { animation: d-up-photo-in 5s ease-in-out infinite; }
.demo-uploads .d-up-video { animation: d-up-video-in 5s ease-in-out infinite; }
@keyframes d-up-photo-in {
  0%, 8% { opacity: 0; transform: translateY(10px); }
  20%, 100% { opacity: 1; transform: translateY(0); }
}
@keyframes d-up-video-in {
  0%, 32% { opacity: 0; transform: translateY(10px); }
  44%, 100% { opacity: 1; transform: translateY(0); }
}
.demo-uploads p.d-up-status1,
.demo-uploads p.d-up-status2 {
  align-self: center;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  margin: 0;
}
.demo-uploads .d-up-status1 {
  color: var(--color-stone-400, #a8a29e);
  animation: d-up-status1 5s ease-in-out infinite;
}
.demo-uploads .d-up-status2 {
  color: #0e9f6e;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  animation: d-up-status2 5s ease-in-out infinite;
}
.demo-uploads .d-check-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: #10b981;
  color: #fff;
  font-size: 0.7rem;
}
@keyframes d-up-status1 {
  0%, 46% { opacity: 0; }
  56%, 76% { opacity: 1; }
  86%, 100% { opacity: 0; }
}
@keyframes d-up-status2 {
  0%, 78% { opacity: 0; transform: scale(0.7); }
  90%, 100% { opacity: 1; transform: scale(1); }
}

/* --- gallery --- */
.demo-gallery .d-gallery-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.demo-gallery .d-live-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0e9f6e;
}
.demo-gallery .d-live-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #10b981;
  display: inline-block;
  margin-right: 0.4rem;
  animation: d-live-pulse 1.6s ease-in-out infinite;
}
@keyframes d-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.demo-gallery .d-track {
  width: 15.5rem;
  overflow: hidden;
  display: grid;
  grid-auto-flow: column;
  gap: 0.9rem;
  animation: d-gallery-swipe 6s ease-in-out infinite;
}
.demo-gallery .d-photo {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 1.1rem;
  flex-shrink: 0;
}
@keyframes d-gallery-swipe {
  0%, 15% { transform: translateX(0); }
  35%, 50% { transform: translateX(-7.4rem); }
  70%, 85% { transform: translateX(-14.8rem); }
  100% { transform: translateX(0); }
}

/* --- prompts --- */
.demo-prompts .d-ticker {
  position: relative;
  width: min(22rem, 84vw);
  height: 5.5rem;
}
.demo-prompts .d-chip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  background: var(--color-blush-100, #fbeae2);
  color: var(--color-blush-700, #874c42);
  border-radius: 1.1rem;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.75rem 1.1rem;
  opacity: 0;
  animation: d-ticker 10s ease-in-out infinite;
}
.demo-prompts .d-chip:nth-child(2) { animation-delay: 2s; }
.demo-prompts .d-chip:nth-child(3) { animation-delay: 4s; }
.demo-prompts .d-chip:nth-child(4) { animation-delay: 6s; }
.demo-prompts .d-chip:nth-child(5) { animation-delay: 8s; }
@keyframes d-ticker {
  0%, 2% { opacity: 0; transform: translateY(10px); }
  6%, 14% { opacity: 1; transform: translateY(0); }
  18%, 100% { opacity: 0; transform: translateY(-10px); }
}

/* --- broadcast updates --- */
.demo-updates .d-updates {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  width: 19rem;
}
.demo-updates .d-update {
  background: var(--color-blush-100, #fbeae2);
  color: var(--color-blush-700, #874c42);
  border-radius: 1.1rem;
  padding: 0.75rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  opacity: 0;
  animation-duration: 6s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
.demo-updates .d-update:nth-child(1) { animation-name: d-upd-1; }
.demo-updates .d-update:nth-child(2) { animation-name: d-upd-2; }
.demo-updates .d-update:nth-child(3) { animation-name: d-upd-3; }
@keyframes d-upd-1 {
  0%, 5% { opacity: 0; transform: translateY(10px); }
  15%, 100% { opacity: 1; transform: translateY(0); }
}
@keyframes d-upd-2 {
  0%, 38% { opacity: 0; transform: translateY(10px); }
  48%, 100% { opacity: 1; transform: translateY(0); }
}
@keyframes d-upd-3 {
  0%, 71% { opacity: 0; transform: translateY(10px); }
  81%, 100% { opacity: 1; transform: translateY(0); }
}

/* --- delegate access --- */
.demo-delegate .d-cluster {
  position: relative;
  display: flex;
  align-items: center;
  padding-bottom: 2.4rem;
}
.demo-delegate .d-cluster-avatar {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 999px;
  border: 3px solid #fff;
  box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: scale(0.5);
  animation-duration: 5s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
.demo-delegate .d-cl-1 { background: var(--color-blush-300, #e3a291); margin-left: 0; animation-name: d-cl-1; z-index: 1; }
.demo-delegate .d-cl-2 { background: var(--color-blush-400, #d18d7b); margin-left: -0.9rem; animation-name: d-cl-2; z-index: 2; }
.demo-delegate .d-cl-3 { background: var(--color-blush-500, #c47b6c); margin-left: -0.9rem; animation-name: d-cl-3; z-index: 3; }
@keyframes d-cl-1 {
  0%, 4% { opacity: 0; transform: scale(0.5); }
  14%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes d-cl-2 {
  0%, 24% { opacity: 0; transform: scale(0.5); }
  34%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes d-cl-3 {
  0%, 44% { opacity: 0; transform: scale(0.5); }
  54%, 100% { opacity: 1; transform: scale(1); }
}
.demo-delegate .d-cluster-badge {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(6px);
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-blush-700, #874c42);
  background: var(--color-blush-100, #fbeae2);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  opacity: 0;
  animation: d-cl-badge 5s ease-in-out infinite;
}
@keyframes d-cl-badge {
  0%, 64% { opacity: 0; transform: translateX(-50%) translateY(6px); }
  74%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- printed polaroids --- */
.demo-polaroids .d-collage {
  position: relative;
  width: 17rem;
  height: 11.5rem;
}
.demo-polaroids .d-polaroid {
  position: absolute;
  width: 4.6rem;
  height: 5.4rem;
  background: #fff;
  border-radius: 0.2rem;
  box-shadow: 0 8px 18px -4px rgba(0, 0, 0, 0.25);
  opacity: 0;
  animation-duration: 6s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
.demo-polaroids .d-polaroid::after {
  content: "";
  position: absolute;
  inset: 0.35rem 0.35rem 1.1rem 0.35rem;
  border-radius: 0.15rem;
}
.demo-polaroids .pc1 { top: 0; left: 0; animation-name: d-pc1; }
.demo-polaroids .pc2 { top: 0.3rem; left: 6.8rem; animation-name: d-pc2; }
.demo-polaroids .pc3 { top: 1.2rem; left: 12.4rem; animation-name: d-pc3; }
.demo-polaroids .pc4 { top: 6.5rem; left: 2.4rem; animation-name: d-pc4; }
.demo-polaroids .pc5 { top: 6rem; left: 9rem; animation-name: d-pc5; }
.demo-polaroids .pc1::after { background: var(--color-blush-200, #f1c3b4); }
.demo-polaroids .pc2::after { background: var(--color-blush-300, #e3a291); }
.demo-polaroids .pc3::after { background: var(--color-blush-400, #d18d7b); }
.demo-polaroids .pc4::after { background: var(--color-blush-500, #c47b6c); }
.demo-polaroids .pc5::after { background: var(--color-blush-300, #e3a291); }
@keyframes d-pc1 {
  0%, 0% { opacity: 0; transform: rotate(-8deg) scale(0.6); }
  20%, 100% { opacity: 1; transform: rotate(-8deg) scale(1); }
}
@keyframes d-pc2 {
  0%, 16% { opacity: 0; transform: rotate(6deg) scale(0.6); }
  36%, 100% { opacity: 1; transform: rotate(6deg) scale(1); }
}
@keyframes d-pc3 {
  0%, 32% { opacity: 0; transform: rotate(-4deg) scale(0.6); }
  52%, 100% { opacity: 1; transform: rotate(-4deg) scale(1); }
}
@keyframes d-pc4 {
  0%, 48% { opacity: 0; transform: rotate(5deg) scale(0.6); }
  68%, 100% { opacity: 1; transform: rotate(5deg) scale(1); }
}
@keyframes d-pc5 {
  0%, 64% { opacity: 0; transform: rotate(-6deg) scale(0.6); }
  84%, 100% { opacity: 1; transform: rotate(-6deg) scale(1); }
}

/* Generic pin-and-reveal region — one tall scroll region per item
   (testimonials, pricing), each with a sticky-centered card, same
   mechanic on every viewport. Mirrors the hero journey's pin, just
   for a static card instead of a scrubbed demo. */
.pin-region {
  position: relative;
  min-height: 150vh;
}

.pin-sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  #journey-thread,
  .msg {
    transition: none;
  }
  .demo * {
    animation: none !important;
    opacity: 1 !important;
  }
}
