/* ==================================================================
   Loops and demo videos (video.js). Loaded after showcase.css.
   A loop takes the place of the <img> it upgrades, with the same box.
   ================================================================== */

.phone__screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.browser video { width: 100%; height: auto; display: block; aspect-ratio: 1440 / 928; }
video.patch-img { display: block; aspect-ratio: 3 / 2; background: transparent; }

/* A wide walkthrough under a spread. */
.fz-walk { max-width: 920px; margin: clamp(36px, 4vw, 56px) auto 0; }
.fz-walk .shot-cap { max-width: 640px; margin: 14px 0 0; text-align: left; }

/* ---------- "Watch the demo" ghost button ---------- */
.fz-demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: 600 15px/1.2 "Inter", system-ui, sans-serif;
  cursor: pointer;
}
.fz-demo-btn__play {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid currentColor;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.fz-demo-btn__play svg { width: 13px; height: 13px; margin-left: 2px; }
.fz-demo-btn:hover .fz-demo-btn__play,
.fz-demo-btn:focus-visible .fz-demo-btn__play { background: #fff; color: #0a0a0a; border-color: #fff; }
[data-theme="light"] .fz-demo-btn:hover .fz-demo-btn__play,
[data-theme="light"] .fz-demo-btn:focus-visible .fz-demo-btn__play { background: #0a0a0a; color: #fff; border-color: #0a0a0a; }
.fz-demo-btn small { font-size: 13px; font-weight: 500; opacity: 0.6; margin-left: 2px; }

/* ---------- Demo cards ---------- */
.fz-demos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 20px;
  margin-top: clamp(40px, 5vw, 64px);
}
.fz-demo-card {
  display: block;
  align-self: start; /* a <button> centres its content when the grid stretches it */
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.fz-demo-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #0b0b0c;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 60px -36px rgba(0, 0, 0, 0.8);
}
[data-theme="light"] .fz-demo-card__media {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 30px 60px -36px rgba(0, 0, 0, 0.45);
}
.fz-demo-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.fz-demo-card:hover .fz-demo-card__media img,
.fz-demo-card:focus-visible .fz-demo-card__media img { transform: scale(1.03); }
.fz-demo-card__len {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border-radius: 100px;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(6px);
  color: #fff;
  font: 700 12px/1 "Inter", system-ui, sans-serif;
  letter-spacing: 0.02em;
}
.fz-demo-card__len svg { width: 10px; height: 10px; }
.fz-demo-card__k {
  display: block;
  margin-top: 16px;
  font: 700 11px/1 "Inter", system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, #ff4848);
}
.fz-demo-card__t { display: block; margin-top: 8px; font-size: 18px; font-weight: 700; line-height: 1.25; }
.fz-demo-card__d { display: block; margin-top: 6px; font-size: 14px; line-height: 1.5; opacity: 0.66; }

/* ---------- Lightbox ---------- */
.fz-lightbox {
  /* The site reset zeroes margins, which kills the native centring. */
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  max-height: none;
  width: min(1232px, 94vw, calc((100vh - 170px) * 16 / 9 + 32px));
  max-width: none;
  padding: 12px;
  border: 0;
  border-radius: 22px;
  background: #0b0b0c;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: visible;
}
.fz-lightbox::backdrop { background: rgba(5, 5, 6, 0.86); backdrop-filter: blur(4px); }
.fz-lightbox video { width: 100%; display: block; aspect-ratio: 16 / 9; border-radius: 12px; background: #000; }
.fz-lightbox__close {
  position: absolute;
  top: -48px;
  right: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(10, 10, 10, 0.6);
  color: #fff;
  cursor: pointer;
}
.fz-lightbox__close:hover,
.fz-lightbox__close:focus-visible { background: #fff; color: #0a0a0a; }

/* The walkthrough loops carry their own browser and phone, so the frame is
   just a rounded dark plate. */
.fz-walk__media {
  border-radius: 18px;
  overflow: hidden;
  background: #0b0b0c;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 30px 60px -36px rgba(0, 0, 0, 0.75);
}
[data-theme="light"] .fz-walk__media {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.1),
    0 40px 80px -40px rgba(0, 0, 0, 0.45),
    0 16px 32px -20px rgba(0, 0, 0, 0.3);
}
.fz-walk__media img,
.fz-walk__media video { width: 100%; height: auto; display: block; aspect-ratio: 1440 / 928; }

/* "See it working" strip under a section. */
.fz-demos-wrap { margin-top: clamp(48px, 5vw, 80px); }
.fz-demos-wrap .fz-demos { margin-top: 32px; }

/* What the demo covers, under the player. */
.fz-lightbox__summary {
  margin: 0;
  padding: 14px 10px 6px;
  max-width: 820px;
  font: 500 14px/1.5 "Inter", system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.72);
}

/* Overview loop under "One app for all three". */
.fz-overview { margin-top: clamp(40px, 5vw, 64px); }
/* The header already spaces itself from what follows; don't double it. */
.s-header + .fz-overview { margin-top: 0; }

/* A stacked section header: eyebrow, title, then the intro under it (not beside
   it), so it reads straight down into a full-width video. */
.s-header--stack { grid-template-columns: 1fr !important; gap: 20px; margin-bottom: clamp(32px, 4vw, 48px); }
.s-header--stack .s-header__intro { align-self: start; padding-top: 0; max-width: 680px; }
.fz-overview__media {
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 30px 60px -36px rgba(0, 0, 0, 0.45);
}
.fz-overview__media img,
.fz-overview__media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fz-overview + .doors { margin-top: clamp(40px, 5vw, 64px); }

/* Phones: the partner-web half of a walkthrough is unreadable at 390px
   (text renders ~4px). Show only the right-hand 500px of the 1440x928 frame,
   where the phone (and the TV in walk-community) sits in every walk-* loop. */
@media (max-width: 599px) {
  .fz-walk__media { aspect-ratio: 500 / 928; max-width: 320px; margin-inline: auto; }
  .fz-walk__media img,
  .fz-walk__media video { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; object-position: 100% 50%; }
  .fz-walk .shot-cap { margin-inline: auto; max-width: 320px; }
}
