/* Product clip showcase (js/showcase.js).
 *
 * One player per product page: a framed video on one side, the list of clips on the
 * other, and under the video the steps of the clip playing, each lit up while it is on
 * screen. The page sets the palette through four custom properties on the container:
 *   --sc-accent      accent (active step, progress, focus)
 *   --sc-ink         text colour of the section
 *   --sc-muted       secondary text
 *   --sc-surface     background of the list items and the frame bar
 */
.showcase {
  --sc-accent: #3b82f6;
  --sc-ink: #14161f;
  --sc-muted: #5d6272;
  --sc-surface: #ffffff;
  --sc-line: rgba(20, 22, 31, 0.1);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 2rem;
  align-items: start;
  color: var(--sc-ink);
}
.showcase--phone { grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); }

.showcase__stage { min-width: 0; }

/* The window around the video */
.showcase__frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--sc-surface);
  box-shadow: 0 30px 60px -20px rgba(10, 14, 30, 0.35), 0 10px 22px -12px rgba(10, 14, 30, 0.25),
              0 0 0 1px var(--sc-line);
}
.showcase__bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: linear-gradient(to bottom, rgba(255,255,255,0.9), rgba(245,246,250,0.9));
  border-bottom: 1px solid var(--sc-line);
}
.showcase__dots { display: flex; gap: 6px; flex: none; }
.showcase__dots i { width: 11px; height: 11px; border-radius: 50%; background: #d8dbe3; display: block; }
.showcase__dots i:nth-child(1) { background: #ff5f57; }
.showcase__dots i:nth-child(2) { background: #febc2e; }
.showcase__dots i:nth-child(3) { background: #28c840; }
.showcase__address {
  flex: 1; min-width: 0;
  font-family: "JetBrains Mono", monospace; font-size: 0.78rem; color: #5d6272;
  background: #eceef3; border-radius: 6px; padding: 0.3rem 0.7rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.showcase__toggle {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; background: transparent; color: #3a3f4d; cursor: pointer;
}
.showcase__toggle:hover { background: rgba(0,0,0,0.06); }
.showcase__toggle svg { width: 13px; height: 13px; }

.showcase__screen { position: relative; background: #f3f4f7; cursor: pointer; }
.showcase__screen video,
.showcase__screen img { display: block; width: 100%; height: auto; }
.showcase__screen img { position: absolute; inset: 0; height: 100%; object-fit: cover; transition: opacity .35s ease; }
.showcase__screen.is-playing img { opacity: 0; pointer-events: none; }

.showcase__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 76px; height: 76px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--sc-accent); color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3), 0 0 0 10px rgba(255,255,255,0.35);
  transition: transform .2s ease, opacity .25s ease;
}
.showcase__play svg { width: 24px; height: 24px; margin-left: 4px; }
.showcase__play:hover { transform: translate(-50%, -50%) scale(1.06); }
.showcase__screen.is-playing .showcase__play { opacity: 0; pointer-events: none; }

/* Phone variant: the clip is a phone screen */
.showcase--phone .showcase__frame {
  max-width: 300px; margin: 0 auto; border-radius: 40px; padding: 11px;
  background: #16181f;
  box-shadow: 0 40px 70px -24px rgba(10,14,30,0.55), inset 0 0 0 2px #2c2f3a;
}
.showcase--phone .showcase__bar { display: none; }
.showcase--phone .showcase__screen { border-radius: 30px; overflow: hidden; }
.showcase--phone .showcase__notch {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 24px; border-radius: 14px; background: #16181f; z-index: 2;
}

/* Steps under the video */
.showcase__segments { display: flex; gap: 4px; margin: 1.1rem 0 0.85rem; }
.showcase__segments span {
  flex: 1; height: 4px; border-radius: 2px; background: var(--sc-line); overflow: hidden; position: relative;
}
.showcase__segments span b {
  position: absolute; inset: 0; width: 0; background: var(--sc-accent); display: block;
}
.showcase__caption {
  display: flex; gap: 0.9rem; align-items: baseline; min-height: 3.2em;
}
.showcase__num {
  flex: none;
  font-family: "JetBrains Mono", monospace; font-size: 0.8rem; color: var(--sc-accent);
  letter-spacing: 0.04em;
}
.showcase__text {
  font-size: 1.12rem; line-height: 1.45; color: var(--sc-ink);
  transition: opacity .25s ease;
}
.showcase__text.is-swapping { opacity: 0; }

/* The list of clips */
.showcase__list {
  list-style: none; margin: 0; padding: 4px 8px 4px 4px; display: grid; gap: 0.6rem; align-content: start;
  /* Desktop: as tall as the video (max-height set by showcase.js), the clips scroll inside. */
  position: relative; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--sc-line) transparent;
}
.showcase__list.has-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent); }
.showcase__list.has-above { -webkit-mask-image: linear-gradient(to top, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to top, #000 calc(100% - 48px), transparent); }
.showcase__list.has-above.has-below { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.showcase__item {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.85rem; align-items: start;
  width: 100%; text-align: left; cursor: pointer;
  padding: 0.9rem 1rem; border-radius: 10px;
  background: var(--sc-surface); color: var(--sc-ink);
  border: 1px solid var(--sc-line);
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.showcase__item:hover { border-color: var(--sc-accent); transform: translateX(2px); }
.showcase__item:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.showcase__item-num {
  grid-row: span 2;
  font-family: "JetBrains Mono", monospace; font-size: 0.78rem; color: var(--sc-muted);
  padding-top: 0.15rem;
}
.showcase__item-title { font-weight: 600; font-size: 0.98rem; line-height: 1.3; }
.showcase__item-sub { font-size: 0.86rem; line-height: 1.4; color: var(--sc-muted); }
.showcase__item-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--sc-accent); }
.showcase__item.is-active { border-color: var(--sc-accent); box-shadow: 0 8px 22px -12px rgba(0,0,0,0.35); }
.showcase__item.is-active .showcase__item-num { color: var(--sc-accent); }

@media (max-width: 960px) {
  .showcase, .showcase--phone { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .showcase__list {
    grid-auto-flow: column; grid-auto-columns: minmax(220px, 72%);
    overflow-x: auto; overflow-y: visible; scroll-snap-type: x mandatory; padding-bottom: 0.4rem;
    max-height: none; -webkit-mask-image: none; mask-image: none;
    order: 2;
  }
  .showcase__item { scroll-snap-align: start; }
  .showcase__item:hover { transform: none; }
  .showcase__text { font-size: 1rem; }
  .showcase__address { font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .showcase__item, .showcase__play, .showcase__text, .showcase__screen img { transition: none; }
}
.showcase__notch { display: none; }
.showcase--phone .showcase__notch { display: block; }

/* Full screen: the stage (video + steps) centred on a dark backdrop */
.showcase__stage:fullscreen {
  background: #0d1017; display: flex; flex-direction: column; justify-content: center;
  padding: 3vh 4vw; box-sizing: border-box;
}
.showcase__stage:fullscreen .showcase__frame { width: min(100%, calc((94vh - 7rem) * 1.6)); margin: 0 auto; }
.showcase--phone .showcase__stage:fullscreen .showcase__frame { width: min(100%, calc((94vh - 7rem) * 0.46)); }
.showcase__stage:fullscreen .showcase__segments,
.showcase__stage:fullscreen .showcase__caption { width: min(100%, calc((94vh - 7rem) * 1.6)); margin-left: auto; margin-right: auto; }
.showcase__stage:fullscreen .showcase__text { color: #f2f4f8; font-size: 1.3rem; }
.showcase__stage:fullscreen .showcase__segments span { background: rgba(255,255,255,0.18); }

/* Short looping clip in a product hero (video.hero-loop) */
video.hero-loop { display: block; width: 100%; height: auto; background: #f3f4f7; }

/* Inline FontAwesome icons inside text and buttons */
.ico { display: inline-block; width: 0.9em; height: 0.9em; vertical-align: -0.1em; }
.ico--arrow { width: 0.85em; height: 0.85em; margin-left: 0.15em; }

/* "Peace of mind" block of the product pages: four reasons to trust the product */
.assure {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; margin-top: 2.2rem;
}
.assure__item {
  background: var(--assure-surface, #ffffff);
  border: 1px solid var(--assure-line, rgba(20, 22, 31, 0.1));
  border-radius: 14px; padding: 1.4rem 1.3rem 1.5rem;
}
.assure__icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--assure-soft, rgba(59, 130, 246, 0.1)); color: var(--assure-accent, #3b82f6);
  margin-bottom: 1rem;
}
.assure__icon svg { width: 20px; height: 20px; }
.assure__title { font-size: 1.02rem; line-height: 1.3; margin: 0 0 0.45rem; font-weight: 600; }
.assure__text { font-size: 0.92rem; line-height: 1.55; margin: 0; color: var(--assure-muted, #5d6272); }
@media (max-width: 1000px) { .assure { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .assure { grid-template-columns: minmax(0, 1fr); } }

/* A phone in a product hero, playing a short loop */
.hero-phone { margin: 0; }
.hero-phone__body {
  width: min(300px, 78vw); margin: 0 auto; padding: 11px; border-radius: 40px;
  background: #16181f; box-shadow: 0 40px 80px -24px rgba(0,0,0,0.55), inset 0 0 0 2px #2c2f3a;
}
.hero-phone__body video { border-radius: 30px; aspect-ratio: 390 / 844; object-fit: cover; }
