/* HQ product page (/products/hq/) and the homepage #hq section.
   Illustrated mockups and the data-flow diagram are inline SVG with sample content.
   Tokens come from site.css; the fallbacks keep the sheet safe on any page. */

.hq-page,
.hq-home {
  --hq-surface: var(--ui-surface-1, #11110f);
  --hq-border: var(--line, rgba(245, 240, 232, 0.14));
  --hq-cyan: #8debf2;
  --hq-green: #c6ffb3;
  --hq-soft: #aaa49a;
}

/* ---- Illustrated figures ------------------------------------------ */
.hq-shot { margin: 0; }
.hq-shot svg { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: var(--ui-shadow, 0 18px 48px -12px rgba(0, 0, 0, 0.6)); }
.hq-shot figcaption,
.hq-flow figcaption {
  margin-top: 0.6rem;
  font: 400 0.85rem/1.4 "IBM Plex Sans", sans-serif;
  color: var(--hq-soft);
}

/* ---- Hero --------------------------------------------------------- */
.hq-hero { display: grid; gap: 2rem; align-items: center; padding-top: 1rem; }
.hq-hero__copy { max-width: 40rem; }
.hq-hero__media { min-width: 0; }
@media (min-width: 62rem) {
  .hq-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 4.5rem); }
}

/* ---- Sections ----------------------------------------------------- */
.hq-section { padding-block: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--hq-border); }
main.site-page > .hq-section { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.hq-section h2 { max-width: 22ch; }
.hq-section h3 { margin-top: 1.4rem; }
.hq-more { margin-top: 1.5rem; color: var(--hq-soft); }
.hq-more a, .hq-split a { color: var(--hq-cyan); }

/* ---- Data-flow diagram -------------------------------------------- */
.hq-flow { margin: 2rem 0 0; }
.hq-flow svg { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--hq-border); }
.hq-flow__tall { display: none; max-width: 30rem; margin-inline: auto; }
@media (max-width: 52rem) {
  .hq-flow__wide { display: none; }
  .hq-flow__tall { display: block; }
}
.hq-steps { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 0.75rem; counter-reset: hq-step; }
.hq-steps li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0.9rem; padding: 1rem 1.1rem; background: var(--hq-surface); border: 1px solid var(--hq-border); border-radius: 8px; }
.hq-steps h3 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.hq-steps p { margin: 0; color: var(--hq-soft); max-width: none; }
.hq-steps__n { font: 500 0.85rem/1.9 "IBM Plex Sans", sans-serif; color: #ff8a6b; letter-spacing: 0.04em; }
@media (min-width: 52rem) {
  .hq-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Split rows --------------------------------------------------- */
.hq-split { display: grid; gap: 2rem; align-items: center; }
.hq-split__copy, .hq-split__media { min-width: 0; }
.hq-split__copy p { color: var(--hq-soft); max-width: 40rem; }
.hq-split__copy > p:first-of-type:not(.eyebrow) { color: var(--ink, #f5f0e8); }
@media (min-width: 62rem) {
  .hq-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 4.5rem); }
  .hq-split--flip .hq-split__copy { order: 2; }
  .hq-split--flip .hq-split__media { order: 1; }
}
.hq-points { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.hq-points li { padding: 0.75rem 1rem; border-left: 2px solid var(--accent, #ff4b24); background: var(--hq-surface); border-radius: 0 8px 8px 0; color: var(--hq-soft); max-width: 40rem; }
.hq-points strong { color: var(--ink, #f5f0e8); font-family: "Inter Tight", sans-serif; font-weight: 600; }
.hq-networks { display: flex; flex-wrap: wrap; gap: 0.4rem 0.5rem; list-style: none; margin: 0.9rem 0 0; padding: 0; }
.hq-networks li { padding: 0.2rem 0.7rem; border: 1px solid var(--hq-border); border-radius: 999px; font: 500 0.9rem/1.5 "Inter Tight", sans-serif; color: var(--ink, #f5f0e8); background: var(--hq-surface); }

/* ---- Security, FAQ, CTA ------------------------------------------- */
.hq-security p { max-width: 42rem; color: var(--hq-soft); }
.hq-security a { color: var(--hq-cyan); }
.hq-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 1.1rem 0 0; padding: 0; font-family: "Inter Tight", sans-serif; }
.hq-faq .faq-list { max-width: 46rem; margin-top: 1rem; }
.hq-cta { margin-top: clamp(2rem, 5vw, 3.5rem); padding-block: clamp(2rem, 5vw, 3.5rem) !important; border: 1px solid var(--hq-border); border-radius: 8px; }

/* ---- Homepage section --------------------------------------------- */
.hq-home { border-top: 1px solid var(--hq-border); }
.hq-home h2 { max-width: 20ch; }
.hq-home__beats { list-style: none; margin: 2.2rem 0 0; padding: 0; display: grid; gap: 1.75rem; }
.hq-home__beat { min-width: 0; }
.hq-home__beat h3 { margin: 1rem 0 0.35rem; }
.hq-home__beat p { margin: 0; color: var(--hq-soft); max-width: 34rem; }
.hq-home__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin: 2.2rem 0 0; }
.hq-home__more { margin: 1.1rem 0 0; color: var(--hq-soft); }
.hq-home__more a { color: var(--hq-cyan); }
@media (min-width: 52rem) {
  .hq-home__beats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
}

/* ---- Motion (opacity only, off for reduced motion) ---------------- */
@media (prefers-reduced-motion: no-preference) {
  .hq-flow-loop, .hq-mock-slot { animation: hq-pulse 3s ease-in-out infinite; }
  .hq-flow-link { animation: hq-pulse 2.4s ease-in-out infinite; }
  .hq-mock-pulse { animation: hq-pulse 3.2s ease-in-out infinite; }
}
@keyframes hq-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) {
  .hq-flow-loop, .hq-flow-link, .hq-mock-pulse, .hq-mock-slot { animation: none !important; }
}

/* ---- Spacing fixes ------------------------------------------------- */
.hq-section .eyebrow, .hq-home .eyebrow { margin: 0 0 0.55rem; }
.hq-section h2, .hq-home h2 { margin-top: 0; }
@media (min-width: 52rem) {
  .hq-steps li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---- Homepage #hq-video (Meet HQ), right after #hero: an intro band, then a full-bleed stage one viewport tall.
   With .is-scrub (set by hq-video.js when motion is allowed) the track grows to --hq-span viewports and the
   stage pins while the wheel scrubs the film. ---- */
.hq-video {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0;
  background: #070706;
  color: var(--ink, #f5f0e8);
}
.hq-video__intro {
  box-sizing: border-box;
  padding: clamp(4rem, 12vh, 8rem) max(1rem, 6vw) clamp(1.75rem, 5vh, 3rem);
}
.hq-video__intro h2 {
  margin: 0;
  font: 600 clamp(2.75rem, 7vw, 6rem)/1 "Inter Tight", sans-serif;
  letter-spacing: -0.03em;
}
.hq-video__tagline {
  max-width: 36rem;
  margin: 0.85rem 0 0;
  font: 400 clamp(1.05rem, 1.6vw, 1.35rem)/1.4 "IBM Plex Sans", sans-serif;
  color: rgba(245, 240, 232, 0.72);
}
/* The mask reserves room under the baseline so descenders are not sheared off. */
.hq-kin { display: inline-block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; vertical-align: top; }
.hq-kin > span { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .hq-video.is-kinetic .hq-kin > span { transform: translateY(110%); transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
  .hq-video.is-kinetic .hq-kin + .hq-kin > span { transition-delay: 0.09s; }
  .hq-video.is-kinetic .hq-video__tagline { opacity: 0; transform: translateY(0.6rem); transition: opacity 0.7s ease 0.3s, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s; }
  .hq-video.is-kinetic.is-in .hq-kin > span,
  .hq-video.is-kinetic.is-in .hq-video__tagline { opacity: 1; transform: none; }
}
.hq-video__track { position: relative; }
.hq-video.is-scrub .hq-video__track { height: calc(var(--hq-span, 3.4) * 100vh); height: calc(var(--hq-span, 3.4) * 100svh); }
.hq-video__stage {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.hq-video.is-scrub .hq-video__stage { position: sticky; top: 0; }
.hq-video.is-scrub .hq-video__toggle { display: none; }
.hq-video__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;
}
/* Blurred copy of the poster fills any bars, so contain never shows a hard edge. */
.hq-video__ambient {
  position: absolute;
  inset: -8%;
  z-index: 0;
  background: #070706 var(--hq-video-poster) center / cover no-repeat;
  filter: blur(40px) brightness(0.2) saturate(0.9);
}
.hq-video__poster { position: absolute; inset: 0; z-index: 1; display: block; }
.hq-video__frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  /* Default: show the whole frame. The lower thirds sit in the bottom 15% and left 5%, so cover is only used near the source ratio. */
  object-fit: contain;
  object-position: center;
  background: transparent;
}
.hq-video__media { z-index: 2; opacity: 0; transition: opacity 0.4s ease; }
.hq-video.is-ready .hq-video__media { opacity: 1; }
/* Landscape within about 1.70 to 1.85 (16:9 is 1.78): cover crops at most 2.2% per side or 1.9% top and bottom. */
@media (min-aspect-ratio: 17/10) and (max-aspect-ratio: 37/20) {
  .hq-video__frame { object-fit: cover; }
}
/* Portrait close to the 9:16 cut (0.5625), only when a vertical cut exists (otherwise the landscape cut is contained): cover crops at most about 3% per side. */
@media (min-aspect-ratio: 27/50) and (max-aspect-ratio: 3/5) {
  .hq-video--has-portrait .hq-video__frame { object-fit: cover; }
}
@media (max-aspect-ratio: 1/1) {
  .hq-video__ambient { background-image: var(--hq-video-poster-portrait); }
}
.hq-video__scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(to top, rgba(7, 7, 6, 0.38) 0%, rgba(7, 7, 6, 0) 22%);
}
.hq-video__bar {
  position: absolute;
  z-index: 4;
  right: max(1rem, 3vw);
  /* Clears the site's chat launcher at the bottom right, and keeps off the video's lower third (left side). */
  bottom: max(5.5rem, 8.5svh);
  left: max(1rem, 3vw);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem 0.75rem;
  pointer-events: none;
}
.hq-video__bar > * { pointer-events: auto; }
.hq-video__links { display: flex; flex-wrap: wrap; gap: 0.5rem 0.6rem; margin-top: 1.4rem; }
.hq-video__links a,
.hq-video__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(245, 240, 232, 0.28);
  border-radius: 999px;
  background: rgba(7, 7, 6, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--ink, #f5f0e8);
  font: 500 0.82rem/1.2 "IBM Plex Sans", sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.hq-video__links a:hover,
.hq-video__toggle:hover { border-color: rgba(245, 240, 232, 0.6); }
.hq-video__toggle .hq-video__icon--pause { display: none; }
.hq-video.is-playing .hq-video__icon--play { display: none; }
.hq-video.is-playing .hq-video__icon--pause { display: block; }
@media (max-width: 40rem) {
  .hq-video__links a, .hq-video__toggle { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .hq-video__media { transition: none; }
}
