/* TrickerAI landing: hero demo (js/landing-demo.js). Everything is scoped to .tk-demo.
   Tokens come from app/css/base.css; the fallbacks keep it intact without it. */

.tk-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  -webkit-tap-highlight-color: transparent;
}

.tk-demo,
.tk-demo * {
  box-sizing: border-box;
}

/* Zero-specificity reset so the component rules below always win. */
:where(.tk-demo) button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.35s var(--spring, cubic-bezier(0.34, 1.56, 0.64, 1)), background-color 0.2s ease,
    color 0.2s ease, box-shadow 0.25s ease;
}

.tk-demo ion-icon {
  display: block;
  flex: none;
  width: 1em;
  height: 1em;
}

/* ---------- Stage ---------- */

.tk-demo__stage {
  position: relative;
  display: block;
  flex: none;
  /* Phone: ~74% of the screen so stage + chips stay under ~440px tall at 375px. */
  width: min(100%, 360px, 74vw, 46vh);
  width: min(100%, 360px, 74vw, 46svh);
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--r-xl, 24px);
  background: var(--surface-muted, #f3eee8);
  box-shadow: 0 6px 18px rgba(26, 28, 34, 0.06), 0 26px 46px -22px rgba(98, 66, 217, 0.5);
  transform: translateZ(0); /* keeps animated layers inside the rounded clip on Safari */
  text-align: left;
}

@supports not (aspect-ratio: 1) {
  .tk-demo__stage::before {
    content: '';
    display: block;
    padding-top: 133.34%;
  }
}

.tk-demo__slide,
.tk-demo__rev,
.tk-demo__line,
.tk-demo__flash,
.tk-demo__stage img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.tk-demo__stage img {
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.tk-demo__slide {
  opacity: 0;
}

/* "After" layer: the wrapper slides down while the photo counter-slides, so the
   reveal edge moves top → bottom on the compositor, in sync with the scan line. */
.tk-demo__rev {
  overflow: hidden;
  transform: translateY(-100%);
}

.tk-demo__rev img {
  transform: translateY(100%);
}

.tk-demo__line,
.tk-demo__flash {
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}

.tk-demo__line {
  transform: translateY(-100%);
}

.tk-demo__line::before,
.tk-demo__line::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
}

/* Soft beam around the line. */
.tk-demo__line::before {
  bottom: -30px;
  height: 60px;
  background: linear-gradient(rgba(123, 92, 250, 0), rgba(123, 92, 250, 0.26), rgba(123, 92, 250, 0));
}

/* The scan line itself: 3px accent with glow, like the app's scanner. */
.tk-demo__line::after {
  bottom: -1.5px;
  height: 3px;
  background: var(--accent, #7b5cfa);
  box-shadow: 0 0 10px 2px rgba(123, 92, 250, 0.9), 0 0 28px 4px rgba(123, 92, 250, 0.45);
}

.tk-demo__flash {
  background: radial-gradient(130% 75% at 50% 100%, #fff, rgba(243, 240, 253, 0.75) 55%, rgba(243, 240, 253, 0.3));
}

/* Bottom shade so the pills read on bright photos. */
.tk-demo__stage::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 30%;
  background: linear-gradient(rgba(20, 16, 14, 0), rgba(20, 16, 14, 0.3));
  pointer-events: none;
}

.tk-demo__tag,
.tk-demo__label,
.tk-demo__try {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill, 999px);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.tk-demo__tag {
  top: 12px;
  left: 12px;
  gap: 4px;
  padding: 6px 9px;
  font-size: 12px;
  letter-spacing: 0.2px;
  color: var(--charcoal, #1a1c22);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(26, 28, 34, 0.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
}

.tk-demo__tag--after {
  color: #fff;
  background: var(--accent, #7b5cfa);
  box-shadow: 0 4px 14px rgba(98, 66, 217, 0.45);
}

.tk-demo__tag ion-icon {
  font-size: 12px;
}

/* Prank name: the app's dark translucent card label, a size up. */
.tk-demo__label {
  left: 12px;
  bottom: 12px;
  gap: 6px;
  max-width: calc(100% - 112px);
  padding: 8px 12px 8px 10px;
  font-size: 13px;
  letter-spacing: -0.1px;
  color: #fff;
  background: var(--scrim, rgba(20, 16, 14, 0.38));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
}

.tk-demo__label ion-icon {
  font-size: 15px;
}

.tk-demo__label span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-demo__try {
  right: 12px;
  bottom: 12px;
  gap: 4px;
  padding: 8px 10px 8px 12px;
  font-size: 12px;
  color: var(--charcoal, #1a1c22);
  background: #fff;
  box-shadow: 0 4px 12px rgba(26, 28, 34, 0.16);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tk-demo__try ion-icon {
  font-size: 13px;
}

/* ---------- Chips ---------- */

.tk-demo__chips {
  position: relative;
  display: flex;
  gap: 8px;
  width: 100%;
  padding: 4px var(--tk-demo-row-pad, 16px);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--tk-demo-row-pad, 16px);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* Edge fades cover only the side padding, so resting chips stay crisp. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--tk-demo-row-pad, 16px), #000 calc(100% - var(--tk-demo-row-pad, 16px)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--tk-demo-row-pad, 16px), #000 calc(100% - var(--tk-demo-row-pad, 16px)), transparent);
}

.tk-demo__chips::-webkit-scrollbar {
  display: none;
}

.tk-demo__chip {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px 0 13px;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--r-pill, 999px);
  background: var(--surface, #fff);
  box-shadow: inset 0 0 0 1px var(--border-strong, #e3d9d1);
  color: var(--text, #1a1c22);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  scroll-snap-align: center;
}

.tk-demo__chip ion-icon {
  font-size: 16px;
  color: var(--text-2, #8c8480);
  transition: color 0.2s ease;
}

.tk-demo__chip[aria-pressed='true'] {
  color: var(--accent-dark, #6242d9);
  background: var(--accent-tint, #f3f0fd);
  box-shadow: inset 0 0 0 1px var(--accent-soft, #e4ddfb);
}

.tk-demo__chip[aria-pressed='true'] ion-icon {
  color: inherit;
}

/* Auto-advance progress: a thin accent line along the active chip's bottom edge
   (the chip itself stays fully tinted). */
.tk-demo__fill {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent, #7b5cfa);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.tk-demo__chip:not([aria-pressed='true']) .tk-demo__fill {
  visibility: hidden;
}

@media (hover: hover) {
  .tk-demo__stage:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(26, 28, 34, 0.08), 0 32px 54px -22px rgba(98, 66, 217, 0.58);
  }
  .tk-demo__stage:hover .tk-demo__try {
    color: #fff;
    background: var(--accent, #7b5cfa);
  }
  .tk-demo__chip:not([aria-pressed='true']):hover {
    background: var(--surface-muted, #f3eee8);
  }
}

/* Wide screens with a mouse: show every chip (wrapped) instead of a scroller. */
@media (hover: hover) and (pointer: fine) and (min-width: 700px) {
  .tk-demo__chips {
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
    padding-inline: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.tk-demo__stage.is-p {
  transform: scale(0.97);
  transition-duration: 0.12s;
}

.tk-demo__chip.is-p {
  transform: scale(0.95);
  transition-duration: 0.12s;
}

.tk-demo__stage:focus-visible,
.tk-demo__chip:focus-visible {
  outline: 2.5px solid var(--accent, #7b5cfa);
  outline-offset: 2px;
}

.tk-demo__chip:focus-visible {
  outline-offset: 1px;
}
