/* ─── Try pages (swipe.html, chat.html): calmer version of the hero gradient ─── */
body.try-page {
  position: relative;
  isolation: isolate;
  color: var(--white);
  background-color: #7a66f2;
  background-image:
    radial-gradient(60% 55% at 86% 45%, rgba(125, 243, 225, 0.55) 0%, rgba(125, 243, 225, 0) 70%),
    radial-gradient(50% 60% at 60% 110%, rgba(143, 216, 232, 0.5) 0%, rgba(143, 216, 232, 0) 70%),
    linear-gradient(100deg, #5a44d9 0%, #7360ea 28%, #917eff 55%, #9b94f3 75%, #a9d6e6 100%);
  background-attachment: fixed;
}
body.try-page::before {
  content: '';
  position: fixed;
  inset: -2px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n' x='0' y='0'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.6 0 0 0 0.9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 300px 300px;
}
.try-page .nav {
  padding: var(--space-6) var(--gutter) 0;
}
/* sections.css gives <main> its own lavender canvas (home); on try pages the body gradient must show through. */
.try-page main {
  background: none;
}
.try-page main::before {
  display: none;
}
.try-page .nav-links a[aria-current='page'] {
  border-bottom-color: var(--white);
  font-weight: 500;
}

/* Stage: copy on the left, the phone — sized to fit the viewport height — on the right. */
.try-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 6vw, 7rem);
  width: min(100% - 2 * var(--gutter), 1120px);
  min-height: calc(100svh - 110px);
  margin-inline: auto;
  padding-block: clamp(1rem, 3vh, 2rem) clamp(2rem, 5vh, 3.5rem);
}
.try-copy {
  max-width: 480px;
  justify-self: end;
}
.try-title {
  font-size: clamp(2.5rem, 1.4rem + 3.4vw, 4.5rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.try-subtitle {
  margin-top: var(--space-4);
  font-size: clamp(1.0625rem, 1rem + 0.6vw, 1.375rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
}
.try-hint {
  margin-top: var(--space-3);
  max-width: 34em;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.88);
}
.try-title,
.try-subtitle {
  text-shadow: 0 2px 18px rgba(60, 40, 170, 0.3);
}
/* Gesture legend */
.try-gestures {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.try-gesture {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--white);
  text-shadow: 0 1px 6px rgba(60, 40, 170, 0.35);
  white-space: nowrap;
}
.try-kbd {
  display: none;
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.8);
}
.try-kbd kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.16);
  font: inherit;
  font-size: 0.9em;
  text-align: center;
}
@media (hover: hover) and (min-width: 881px) {
  .try-kbd {
    display: block;
  }
}
.try-gesture .icon {
  width: 1.1em;
  height: 1.1em;
  stroke-width: 2;
}
.try-gesture--pass .icon { animation: hintNudgeLeft 2.6s ease-in-out infinite; }
.try-gesture--like .icon { animation: hintNudgeRight 2.6s ease-in-out infinite; }
@keyframes hintNudgeLeft {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-4px); }
}
@keyframes hintNudgeRight {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}
.try-phone {
  display: grid;
  place-items: center;
}
/* Phone width follows the viewport height so the action bar is always on screen. */
.try-phone .phone--demo {
  width: min(380px, calc((100svh - 180px) * 393 / 852));
  min-width: 280px;
  box-shadow:
    0 0 0 2px #2d2b48,
    0 50px 90px -30px rgba(30, 22, 90, 0.7),
    0 0 120px -20px rgba(255, 255, 255, 0.5);
}

/* Bottom download strip — every page ends with the badges */
.try-download {
  padding-block: 0 var(--space-section);
}
.try-download .container {
  width: min(100% - 2 * var(--gutter), 1200px);
}
.try-download-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-8);
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 3.5rem);
  border-radius: var(--radius-panel);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}
.try-download-panel .download-title {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
}
.try-download-panel .download-desc {
  margin-top: var(--space-2);
  font-size: var(--text-base);
}
.try-download-panel .store-badges {
  margin-top: 0;
}
.try-page .footer {
  background: rgba(255, 255, 255, 0.92);
  border-top: 0;
}

/* ─── Match overlay ─── */
.match {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(60, 40, 170, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: matchIn var(--duration-normal) var(--ease-out-expo);
}
.match[hidden] {
  display: none;
}
@keyframes matchIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.match__card {
  position: relative;
  width: min(100%, 460px);
  padding: clamp(2.5rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem) clamp(2.25rem, 4vw, 3rem);
  text-align: center;
  color: var(--white);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 40px 80px -30px rgba(20, 10, 80, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  animation: matchPop 480ms var(--ease-out-expo);
}
@keyframes matchPop {
  from { transform: translateY(24px) scale(0.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.match__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
  cursor: pointer;
}
.match__close:hover {
  background: rgba(255, 255, 255, 0.28);
}
.match__faces {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-4);
}
.match__face {
  width: clamp(110px, 14vw, 140px);
  height: clamp(110px, 14vw, 140px);
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--white);
  box-shadow: 0 20px 40px -16px rgba(20, 10, 80, 0.6);
  background: var(--brand-surface);
}
.match__face--you {
  display: grid;
  place-items: center;
  margin-right: -18px;
  background: linear-gradient(160deg, #e7e5fa, #c1b9f3);
}
.match__face--you img {
  width: 44%;
  height: auto;
}
.match__face--peer {
  margin-left: -18px;
}
.match__plus {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 10px 24px -8px rgba(20, 10, 80, 0.6), 0 2px 10px rgba(53, 41, 140, 0.16);
}
.match__plus .glyph {
  width: 28px;
  height: 28px;
  background: var(--brand);
}
.match__title {
  margin-top: var(--space-8);
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.match__desc {
  margin-top: var(--space-3);
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.9);
}
.match__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  margin-top: var(--space-8);
}
.match__actions .btn--lg {
  min-width: min(100%, 260px);
}
.match__bear {
  position: absolute;
  right: -26px;
  bottom: -30px;
  z-index: -1; /* behind the glass panel: only the head peeks out */
  width: 96px;
  height: auto;
  pointer-events: none;
  transform: rotate(-16deg);
  filter: drop-shadow(0 8px 16px rgba(20, 10, 80, 0.35));
}

/* Confetti: purple + mint dots */
.confetti {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}
.confetti i {
  position: absolute;
  top: 40%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-surface);
  opacity: 0;
  animation: confettiPop 1.4s var(--ease-out-expo) 2;
}
.confetti i:nth-child(3n) { background: #7df3e1; }
.confetti i:nth-child(3n + 1) { background: var(--brand-dark); width: 7px; height: 7px; }
.confetti i:nth-child(2n) { border-radius: 2px; }
@keyframes confettiPop {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(260deg) scale(1); }
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  left: 50%;
  bottom: clamp(1.5rem, 5vh, 3rem);
  z-index: 60;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: 0 14px 30px -12px rgba(20, 10, 80, 0.5);
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: transform var(--duration-normal) var(--ease-out-expo), opacity var(--duration-normal);
  pointer-events: none;
}
.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ─── Responsive ─── */
@media (max-width: 880px) {
  .try-stage {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 0;
    text-align: center;
    gap: clamp(1.5rem, 3vh, 2.5rem);
  }
  .try-copy {
    justify-self: center;
    max-width: 600px;
  }
  .try-hint {
    margin-inline: auto;
  }
  .try-gestures {
    justify-content: center;
  }
  .try-phone {
    width: min(100%, 330px);
  }
  .try-phone .phone--demo {
    width: 100%;
    min-width: 0;
  }
  .try-download-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .try-download-panel .store-badges {
    justify-content: center;
  }
}
@media (max-width: 400px) {
  .try-phone {
    width: min(100%, 300px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .match,
  .match__card,
  .confetti i,
  .try-gesture .icon {
    animation: none;
  }
  .confetti i {
    opacity: 0;
  }
}
