/* Client showcase band. Every class is prefixed svt-showcase.
   Fonts are the Search kit faces, self-hosted from ./fonts (latin subset, SIL OFL 1.1). */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens. The ONLY place colour is defined in this component. ----------
   Keep in sync with the kit dark tokens in
   brand-marketing/brand/design-system/kit/search-interface.css
   (--paper, --ink, --ink-muted, --accent, --paper-border, dark theme).
   Space separated RGB so it composes with alpha: rgb(var(--svt-sc-ink) / .7).
   Lime only ever appears on this dark surface. */
.svt-showcase {
  --svt-sc-paper: 0 0 0;
  --svt-sc-ink: 255 255 255;
  --svt-sc-ink-muted: 203 202 204;
  --svt-sc-lime: 217 255 42;
  --svt-sc-border: 43 39 44;

  position: relative;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  background: rgb(var(--svt-sc-paper));
  color: rgb(var(--svt-sc-ink));
  padding: clamp(56px, 8vw, 128px) clamp(20px, 6vw, 112px);
}

.svt-showcase *,
.svt-showcase *::before,
.svt-showcase *::after {
  box-sizing: border-box;
}

/* ---- Background: LetterGlitch fills the band, behind everything ---------- */
.svt-showcase__glitch {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* LetterGlitch listens on window, so pointer effects still work through the content. */
  pointer-events: none;
}

/* ---- Two columns --------------------------------------------------------- */
.svt-showcase__inner {
  /* Column gap, also used to keep the narration scrim clear of the video. */
  --svt-sc-gap: clamp(32px, 5vw, 96px);

  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: var(--svt-sc-gap);
  align-items: center;
  max-width: 1440px;
  margin: 0 auto;
}

/* ---- Video --------------------------------------------------------------- */
.svt-showcase__frame {
  position: relative;
  /* Above the narration column, so nothing of the scrim can ever paint over the video. */
  z-index: 2;
  aspect-ratio: 16 / 9;
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgb(var(--svt-sc-ink) / 0.12);
  background: rgb(var(--svt-sc-paper));
  box-shadow:
    0 2px 6px rgb(var(--svt-sc-paper) / 0.35),
    0 28px 56px -16px rgb(var(--svt-sc-paper) / 0.6),
    0 72px 140px -28px rgb(var(--svt-sc-paper) / 0.75);
}

.svt-showcase__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: rgb(var(--svt-sc-paper));
}

/* ---- Narration ----------------------------------------------------------- */
.svt-showcase__narration {
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2vw, 32px);
  min-width: 0;
}

/* Soft scrim so the words stay readable over the glitch. Nothing louder than this.
   It sits behind the video frame in stacking order and, on the video side, stops half way
   into the column gap, so it is confined to the narration side twice over. */
.svt-showcase__narration::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -22% -28% -22% calc(var(--svt-sc-gap) * -0.5);
  pointer-events: none;
  background: radial-gradient(
    closest-side,
    rgb(var(--svt-sc-paper) / 0.6) 0%,
    rgb(var(--svt-sc-paper) / 0.6) 40%,
    rgb(var(--svt-sc-paper) / 0) 100%
  );
}

.svt-showcase__label {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.9em;
  margin: 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(var(--svt-sc-ink-muted));
}

/* Caption region. The invisible sizer holds every caption of the current video, so the
   region is always as tall as the longest one and the layout never jumps. */
.svt-showcase__captions {
  display: grid;
  max-width: 14ch;
  min-height: calc(3 * 1.08em);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: clamp(28px, 3.1vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: rgb(var(--svt-sc-ink));
}

.svt-showcase__sizer,
.svt-showcase__caption {
  grid-area: 1 / 1;
  margin: 0;
  text-wrap: balance;
}

.svt-showcase__sizer {
  display: grid;
  visibility: hidden;
  pointer-events: none;
}

.svt-showcase__sizer > span {
  grid-area: 1 / 1;
}

.svt-showcase__caption {
  align-self: start;
}

/* Outgoing caption: fades out over 240 ms, finishing as the caption ends. */
.svt-showcase__caption.is-leaving {
  opacity: 0;
  transition: opacity 240ms ease-in;
}

/* Incoming caption: word by word. */
.svt-showcase__word {
  display: inline-block;
  animation: svt-showcase-word-in 380ms ease-out both;
  animation-delay: calc(var(--svt-sc-i, 0) * 55ms);
}

@keyframes svt-showcase-word-in {
  from {
    opacity: 0;
    transform: translateY(0.35em);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ---- Progress ------------------------------------------------------------ */
.svt-showcase__meter {
  display: flex;
  align-items: center;
  gap: 18px;
}

.svt-showcase__progress {
  position: relative;
  flex: 1 1 auto;
  height: 2px;
  overflow: hidden;
  border-radius: 1px;
  background: rgb(var(--svt-sc-ink) / 0.16);
}

.svt-showcase__progress-fill {
  position: absolute;
  inset: 0;
  background: rgb(var(--svt-sc-lime));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.svt-showcase__dots {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.svt-showcase__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(var(--svt-sc-border));
  box-shadow: inset 0 0 0 1px rgb(var(--svt-sc-ink) / 0.22);
}

.svt-showcase__dot.is-on {
  background: rgb(var(--svt-sc-lime));
  box-shadow: none;
}

/* ---- Screen readers: every caption of every playable video, as plain text -- */
.svt-showcase__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- Stacked layout ------------------------------------------------------ */
@media (max-width: 880px) {
  .svt-showcase {
    padding: 44px 20px 52px;
  }

  .svt-showcase__inner {
    --svt-sc-gap: 28px;

    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .svt-showcase__narration {
    text-align: left;
  }

  .svt-showcase__narration::before {
    /* Reach the band edges but not past them, and only half way up the gap to the video. */
    inset: calc(var(--svt-sc-gap) * -0.5) -20px -16% -20px;
  }

  .svt-showcase__captions {
    max-width: 16ch;
  }
}

/* ---- Reduced motion: captions without transform or blur ------------------ */
@media (prefers-reduced-motion: reduce) {
  .svt-showcase__word {
    animation: none;
    transform: none;
    filter: none;
  }

  .svt-showcase__caption.is-leaving {
    opacity: 1;
    transition: none;
  }
}

/* ---- Merged into the Feed wall panel (patch/showcase-merge.py) -------------
   The band lives inside the template's rounded dark panel: the panel loses its padding and clips,
   the band goes transparent so the panel's own ink colour shows, and LetterGlitch fills the panel
   edge to edge, cut by the panel's rounded corners. */
[data-framer-name="Feed wall"] > div { padding: 0 !important; overflow: hidden !important; }
[data-framer-name="Feed wall"] > div:has(> #client-showcase-root) { min-height: 0 !important; }
#client-showcase-root .svt-showcase { background: transparent; border-radius: inherit; }

/* ---- Two devices (an item with `phone`) ----------------------------------- */
/* Single-video items: the tablet wrapper is just the frame, the phone is gone. */
.svt-showcase__device,
.svt-showcase__screen {
  position: relative;
  width: 100%;
  height: 100%;
}
.svt-showcase__device--phone,
.svt-showcase__island {
  display: none;
}
.svt-showcase__tag {
  display: none;
}

/* Devices: no stage box, the glitch shows through around a tablet and a phone. */
.svt-showcase__frame.is-devices {
  --svt-sc-bezel: 22 22 24;
  --svt-sc-bezel-edge: 64 64 70;

  aspect-ratio: 16 / 10;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5%;
  /* room under the devices for the tags */
  padding-bottom: 44px;
  box-sizing: border-box;
}
.is-devices .svt-showcase__device {
  height: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.is-devices .svt-showcase__device--tablet {
  flex: 0 0 72%;
}
.is-devices .svt-showcase__device--phone {
  display: flex;
  flex: 0 0 19.6%;
}
.is-devices .svt-showcase__screen {
  overflow: hidden;
  background: rgb(var(--svt-sc-bezel));
  box-shadow:
    inset 0 0 0 1px rgb(var(--svt-sc-bezel-edge) / 0.9),
    0 30px 60px -20px rgb(var(--svt-sc-paper) / 0.8);
}
.is-devices .svt-showcase__device--tablet .svt-showcase__screen {
  aspect-ratio: 16 / 9;
  height: auto;
  padding: 2.6%;
  border-radius: 6% / 10.5%;
  box-sizing: content-box;
  width: calc(100% - 5.2%);
}
.is-devices .svt-showcase__device--tablet .svt-showcase__video {
  border-radius: 1.6% / 2.8%;
}
.is-devices .svt-showcase__device--phone .svt-showcase__screen {
  aspect-ratio: 1080 / 2342;
  height: auto;
  padding: 4.5%;
  border-radius: 17% / 7.8%;
  box-sizing: content-box;
  width: calc(100% - 9%);
}
.is-devices .svt-showcase__device--phone .svt-showcase__video {
  border-radius: 13% / 6%;
  object-fit: cover;
}
.is-devices .svt-showcase__island {
  display: block;
  position: absolute;
  z-index: 1;
  top: 5.6%;
  left: 50%;
  width: 30%;
  height: 3.6%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgb(var(--svt-sc-paper));
}
.is-devices .svt-showcase__tag {
  /* out of flow, so a label wider than the phone never widens the layout */
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--svt-sc-ink-muted));
  padding: 5px 10px;
  border: 1px solid rgb(var(--svt-sc-ink) / 0.14);
  border-radius: 999px;
  background: rgb(var(--svt-sc-paper) / 0.55);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
.is-devices .svt-showcase__tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(var(--svt-sc-lime));
}
@media (max-width: 809.98px) {
  .svt-showcase__frame.is-devices {
    gap: 4%;
    padding-bottom: 34px;
  }
  .is-devices .svt-showcase__device--tablet {
    flex-basis: 70%;
  }
  .is-devices .svt-showcase__device--phone {
    flex-basis: 23%;
  }
  .is-devices .svt-showcase__device--phone .svt-showcase__tag {
    left: auto;
    right: 0;
    transform: none;
  }
  .is-devices .svt-showcase__tag {
    letter-spacing: 0.04em;
    top: calc(100% + 10px);
    font-size: 7.5px;
    padding: 4px 8px;
    gap: 5px;
  }
}

/* ---- Legend: one tab per client, progress fills the playing one ----------- */
.svt-showcase__legend {
  position: relative;
  z-index: 3;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: clamp(12px, 2vw, 28px);
  max-width: 1440px;
  margin: 0 auto clamp(28px, 4vw, 56px);
}
.svt-showcase__tab {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  /* a frosted button: the glitch never shows through the label */
  padding: 14px 16px 20px;
  border: 1px solid rgb(var(--svt-sc-ink) / 0.12);
  border-radius: 14px;
  background: rgb(var(--svt-sc-paper) / 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  color: rgb(var(--svt-sc-ink-muted));
  text-align: left;
  cursor: pointer;
  position: relative;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}
.svt-showcase__tab:hover {
  border-color: rgb(var(--svt-sc-ink) / 0.26);
  background: rgb(var(--svt-sc-paper) / 0.72);
}
.svt-showcase__tab.is-on {
  border-color: rgb(var(--svt-sc-ink) / 0.3);
  background: rgb(var(--svt-sc-paper) / 0.78);
}
.svt-showcase__tab-title {
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgb(var(--svt-sc-ink) / 0.55);
  transition: color 0.3s ease;
}
.svt-showcase__tab-sub {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--svt-sc-ink-muted) / 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.svt-showcase__tab-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 9px;
  height: 2px;
  border-radius: 2px;
  background: rgb(var(--svt-sc-ink) / 0.14);
  overflow: hidden;
}
.svt-showcase__tab-fill {
  position: absolute;
  inset: 0;
  background: rgb(var(--svt-sc-lime));
  transform: scaleX(0);
  transform-origin: left;
}
.svt-showcase__tab.is-done .svt-showcase__tab-fill {
  transform: scaleX(1) !important;
  background: rgb(var(--svt-sc-ink) / 0.4);
}
.svt-showcase__tab.is-on .svt-showcase__tab-title,
.svt-showcase__tab:hover .svt-showcase__tab-title {
  color: rgb(var(--svt-sc-ink));
}
.svt-showcase__tab.is-on .svt-showcase__tab-sub {
  color: rgb(var(--svt-sc-ink-muted));
}
.svt-showcase__tab:focus-visible {
  outline: 2px solid rgb(var(--svt-sc-lime));
  outline-offset: 6px;
  border-radius: 4px;
}
/* the legend carries the position and the progress now */
.svt-showcase__dots,
.svt-showcase__meter {
  display: none;
}
@media (max-width: 809.98px) {
  .svt-showcase__legend {
    gap: 10px;
  }
  .svt-showcase__tab {
    padding: 10px 10px 16px;
    border-radius: 12px;
  }
  .svt-showcase__tab-bar {
    left: 10px;
    right: 10px;
    bottom: 7px;
  }
  .svt-showcase__tab-title {
    font-size: 13px;
  }
  .svt-showcase__tab-sub {
    font-size: 8.5px;
    letter-spacing: 0.04em;
    white-space: normal;
  }
}
