/* ─── Below the fold (Diffui Try_It_Cards_And_Downloads) ─── */

/* Lavender canvas with the same grain, calmer */
main {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(70% 40% at 50% 0%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #e7e5fa 0%, #e0dcfb 50%, #d6d0fa 100%);
}
main::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: multiply;
  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.6 0 0 0 0 0.6 0 0 0 0 0.75 0 0 0 0.9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 300px 300px;
}

/* ─── Try it cards ─── */
.try {
  padding-top: var(--space-section);
}
.try-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: clamp(1rem, 2vw, 1.75rem);
}
.try-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(2rem, 3vw, 3rem) clamp(1.25rem, 3vw, 3rem) clamp(1.75rem, 2.5vw, 2.25rem);
  background: var(--white);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-card);
  overflow: clip; /* tilted side cards must not widen the page on narrow phones */
}
.try-card__title {
  font-size: var(--text-h2);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.try-card__desc {
  max-width: 24em;
  margin-top: var(--space-3);
  font-size: var(--text-lg);
  color: var(--ink-soft);
  text-wrap: balance;
}
.try-card .btn {
  margin-top: auto;
  min-width: min(100%, 290px);
}

/* Photo card stack */
.card-stack {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(300px, 34vw, 380px);
  margin-block: clamp(1.5rem, 3vw, 2.5rem);
}
.photo-card {
  transition: transform var(--duration-normal) var(--ease-out-expo);
  position: absolute;
  width: clamp(150px, 15vw, 190px);
  aspect-ratio: 3 / 4.1;
  padding: 7px;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-photo);
  overflow: hidden;
  transform-origin: 50% 100%;
}
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}
.photo-card figcaption {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  padding: 36px 14px 12px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, rgba(20, 16, 50, 0) 0%, rgba(20, 16, 50, 0.72) 100%);
  color: var(--white);
  text-align: left;
}
.photo-card strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
}
.photo-card figcaption > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
}
.icon--pin {
  width: 1em;
  height: 1em;
  stroke-width: 2;
}
.photo-card--left {
  transform: perspective(1100px) translateX(-62%) rotate(-11deg) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)) scale(calc(0.9 * var(--fx-lift, 1)));
  z-index: 1;
}
.photo-card--right {
  transform: perspective(1100px) translateX(62%) rotate(11deg) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)) scale(calc(0.9 * var(--fx-lift, 1)));
  z-index: 1;
}
.photo-card--center {
  z-index: 2;
  width: clamp(170px, 17vw, 215px);
  transform: perspective(1100px) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)) scale(var(--fx-lift, 1));
}
/* Reflective sheen canvas (js/reflect.js) sits over the photo, under the caption. */
.photo-card > .fx-canvas {
  position: absolute;
  top: 7px;
  left: 7px;
  width: calc(100% - 14px); /* replaced element: inset alone would keep the 300×150 intrinsic size */
  height: calc(100% - 14px);
  border-radius: 14px;
  opacity: 0;
  transition: opacity var(--duration-normal);
  pointer-events: none;
}
.photo-card[data-fx-ready] > .fx-canvas {
  opacity: 1;
}
/* While the pointer drives the tilt, shorten the transform transition so it tracks the hand. */
.photo-card[data-fx-live] {
  transition-duration: 80ms;
}
/* Hover: the stack fans out a little — a hint that the cards can be swiped. */
@media (hover: hover) {
  .try-card:hover .photo-card--left {
    transform: perspective(1100px) translateX(-74%) rotate(-15deg) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)) scale(calc(0.92 * var(--fx-lift, 1)));
  }
  .try-card:hover .photo-card--right {
    transform: perspective(1100px) translateX(74%) rotate(15deg) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)) scale(calc(0.92 * var(--fx-lift, 1)));
  }
  .try-card:hover .photo-card--center {
    transform: perspective(1100px) translateY(-6px) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)) scale(var(--fx-lift, 1));
  }
}

/* Chat preview */
.chat-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  max-width: 560px;
  margin-block: clamp(1.5rem, 3vw, 2.5rem);
  text-align: left;
}
.msg {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.msg--out {
  justify-content: flex-end;
}
.msg__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.msg__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 78%;
}
.msg--out .msg__body {
  align-items: flex-end;
}
.bubble {
  padding: 12px 18px;
  font-size: var(--text-base);
  line-height: 1.45;
  border-radius: 18px;
  background: var(--brand-surface-light);
  color: var(--ink);
  border: 1px solid var(--brand-surface);
}
.msg--in .bubble {
  border-bottom-left-radius: 6px;
}
.msg--out .bubble {
  background: var(--brand);
  color: var(--white);
  border-color: transparent;
  border-bottom-right-radius: 6px;
}
.msg time {
  font-size: var(--text-sm);
  color: var(--neutral-500);
}

/* ─── Flags row ─── */
.flags {
  padding-block: var(--space-section) var(--space-section);
  text-align: center;
}
.flag-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.75rem, 1.6vw, 1.75rem);
}
.flag-row img {
  width: clamp(42px, 4vw, 56px);
  height: clamp(42px, 4vw, 56px);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0, 0, 0, 0.04) inset;
  background: var(--white);
}
.flags-line {
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
  font-size: var(--text-h2);
  font-size: clamp(1.375rem, 1rem + 1.6vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

/* ─── Download block ─── */
.download {
  padding-bottom: var(--space-section);
}
.download .container {
  width: min(100% - 2 * var(--gutter), 1440px);
}
.download-panel {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 5vw, 6rem) clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 8vw, 10rem);
  min-height: 420px;
  background: var(--white);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Home download block: the phone leans like the design render. */
.download-panel .phone {
  justify-self: center;
  transform: rotate(-6deg) translateY(28px);
  transform-origin: 50% 100%;
}

/* Copy */
.download-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
}
.download-eyebrow {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-dark);
}
.download-title {
  margin-top: var(--space-3);
  font-size: var(--text-h2-xl);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}
.download-desc {
  margin-top: var(--space-4);
  max-width: 34em;
  font-size: var(--text-lg);
  color: var(--ink-soft);
}
.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-5);
  margin-top: var(--space-8);
}
.store-badge {
  display: inline-flex;
  height: 60px;
  border-radius: 10px;
  transition: transform var(--duration-fast) var(--ease-out-expo), opacity var(--duration-fast);
}
.store-badge:hover {
  transform: translateY(-2px);
}
.store-badge img {
  height: 100%;
  width: auto;
}
/* Google's PNG badge ships with a transparent margin; trim it visually to match Apple's. */
.store-badge[data-store='android'] {
  height: 76px;
  margin: -8px 0 -8px -10px;
}
.store-badge[aria-disabled='true'] {
  cursor: default;
}
.store-badge[aria-disabled='true']:hover {
  transform: none;
}

/* Decorations */
.scribble {
  position: absolute;
  z-index: 0;
  font-family: var(--font-hand);
  font-size: clamp(1.25rem, 1.6vw, 1.625rem);
  line-height: 1.15;
  color: var(--brand-alt);
  white-space: pre-line;
  pointer-events: none;
}
.scribble--left {
  left: 2%;
  top: 38%;
  transform: rotate(-10deg);
}
.scribble--right {
  right: 3%;
  top: 16%;
  text-align: center;
  transform: rotate(8deg);
}
/* Korean gets a Hangul handwriting face; scripts without one hide the notes instead of falling back to a gothic. */
html[lang='ko'] .scribble {
  font-family: var(--font-hand-ko);
  font-size: clamp(1.1rem, 1.4vw, 1.45rem);
  font-weight: 700;
}
html:is([lang='ja'], [lang='zh-CN'], [lang='zh-TW'], [lang='th'], [lang='vi']) .scribble,
html:is([lang='ja'], [lang='zh-CN'], [lang='zh-TW'], [lang='th'], [lang='vi']) .scribble-arrow {
  display: none;
}
.scribble-arrow {
  position: absolute;
  z-index: 0;
  width: 56px;
  height: auto;
  fill: none;
  stroke: var(--brand-alt);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.scribble-arrow--left {
  left: 9%;
  top: 60%;
}
.scribble-arrow--right {
  right: 12%;
  top: 40%;
  transform: rotate(28deg);
}
.decor-plane {
  position: absolute;
  z-index: 0;
  right: 13%;
  top: 4%;
  width: clamp(120px, 11vw, 170px);
  height: auto;
  pointer-events: none;
}
.decor-globe {
  position: absolute;
  z-index: 0;
  right: 1%;
  bottom: -24%;
  width: clamp(200px, 20vw, 290px);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 20px 30px rgba(53, 41, 140, 0.25));
}

/* ─── Footer ─── */
.footer {
  padding-block: var(--space-8);
  background: var(--brand-surface-faint);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--ink-soft);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5) var(--space-8);
}
.brand--footer .brand-mark {
  width: 30px;
}
.brand--footer .brand-word {
  font-size: 1.25rem;
  color: var(--brand-dark);
}
.footer-links {
  display: flex;
  gap: var(--space-6);
  font-weight: 500;
  color: var(--ink);
}
.footer-links a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.age-badge {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 32px;
  padding-inline: 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--ink);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink);
}
.copyright {
  margin-left: auto;
  font-size: var(--text-sm);
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .scribble--left,
  .scribble-arrow--left {
    display: none;
  }
  .download-panel {
    padding-left: clamp(1.5rem, 4vw, 4rem);
  }
}
@media (max-width: 860px) {
  .download-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: var(--space-8) var(--space-6) 0;
    overflow: visible;
  }
  .phone {
    order: 2;
    transform: rotate(0) translateY(16px);
    margin-top: var(--space-6);
  }
  .download-copy {
    order: 1;
  }
  .download-desc {
    margin-inline: auto;
  }
  .store-badges {
    justify-content: center;
  }
  .store-badge[data-store='android'] {
    margin-left: 0;
  }
  .scribble--right,
  .scribble-arrow--right,
  .decor-globe,
  .decor-plane {
    display: none; /* decorations collide with the stacked copy on phones */
  }
  .footer-row {
    justify-content: center;
    text-align: center;
  }
  .copyright {
    margin-left: 0;
    width: 100%;
  }
}
@media (max-width: 480px) {
  .lang-pill {
    padding-inline: 14px;
  }
  .lang-select {
    max-width: 7em;
  }
  .card-stack {
    height: 250px;
  }
  .photo-card {
    width: 118px;
  }
  .photo-card--center {
    width: 136px;
  }
  .photo-card--left {
    transform: perspective(1100px) translateX(-58%) rotate(-11deg) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)) scale(calc(0.9 * var(--fx-lift, 1)));
  }
  .photo-card--right {
    transform: perspective(1100px) translateX(58%) rotate(11deg) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)) scale(calc(0.9 * var(--fx-lift, 1)));
  }
  .msg__avatar {
    width: 36px;
    height: 36px;
  }
  .msg__body {
    max-width: 86%;
  }
}
