/* ─────────────────────────────────────────────────────────────────────────
   The HubSpot homepage's three feature blocks: personalize, automate, sync.

   Each block is copy on the left and a picture on the right. The picture is
   a rounded frame in three layers:
     1. a gradient in the hero's lagoon colours, a different pair per block;
     2. three blurred orbs drifting slowly over it;
     3. a skeleton of the product UI (.fx-ui) that hubspot-features.js plays
        out on a loop: the story the copy tells.

   The frame is a size container and everything inside .fx-ui is sized in em
   off a font size set in cqw, so the UI scales as one picture: the same
   composition at 640px wide and at 330px, never reflowed.

   The markup is the finished frame of each story. Without JavaScript, or
   with reduced motion, that is what shows; the script's Web Animations hold
   each element in its starting state until its moment comes.
   ───────────────────────────────────────────────────────────────────────── */

.fx {
  /* lagoon, as 0-1 rgb in partners-mesh.js */
  --fx-blue: #71ADE2;
  --fx-cyan: #37ACD9;
  --fx-green: #91BC70;
  --fx-purple: #9180C8;
  --fx-sk: rgba(255, 255, 255, .1);
  --fx-line: rgba(255, 255, 255, .1);
}

/* ───────── the hero, on this page ─────────
   partners.css puts the hero back on the frame's own padding; the unpinned
   logo follows it, as /partners does. */
.hubspot-page .topnav:not(.is-pinned) .brand { margin-left: 0; }

/* ───────── differentiators ─────────
   Three columns under the hero, each an icon above one sentence set like
   the hero's subheadline. The type is 20% toward the page ground, a step
   quieter than the headline above it. A thin grey rule, half the strip's
   height, splits each column from the next. The hero above keeps its own
   bottom spacing; this strip adds the gap down to the screenshot. */
.diffs { padding-bottom: var(--space-3xl); }
.diffs-list {
  --diffs-gap: var(--space-xl);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--diffs-gap);
  margin: 0 auto;
  list-style: none;
}
.diff {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-s);
  text-align: center;
}
.diff + .diff::before {
  content: '';
  position: absolute;
  top: 25%;
  left: calc(var(--diffs-gap) / -2);
  width: 1px;
  height: 50%;
  background: rgba(255, 255, 255, .14);
}
.diff-ico {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--accent);
}
.diff p {
  max-width: 22em;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: color-mix(in oklab, var(--text-primary) 80%, var(--bg));
  text-wrap: pretty;
}
/* Stacked, the columns become rows, so the rules would sit beside nothing. */
@media (max-width: 900px) {
  .diffs-list { grid-template-columns: minmax(0, 1fr); --diffs-gap: var(--space-l); }
  .diff + .diff::before { display: none; }
}

/* ───────── rows ───────── */

.fx-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: var(--space-3xl);
}
.fx-row + .fx-row { margin-top: var(--space-4xl); }

.fx-copy { max-width: 32rem; }
.fx-eyebrow {
  margin: 0 0 var(--space-s);
  color: var(--accent);
  font-size: var(--fs-eye);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.fx-title {
  margin: 0 0 var(--space-m);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.75rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.fx-body {
  margin: 0 0 var(--space-s);
  color: color-mix(in oklab, var(--text-primary) 62%, var(--text-secondary));
  font-size: var(--fs-lead);
  line-height: 1.5;
  text-wrap: pretty;
}
/* The aside is the lesser half of the story: smaller, quieter, set off by a
   short rule so it reads as "and also", not as a second headline point. */
.fx-aside {
  margin: var(--space-m) 0 0;
  padding-left: var(--space-s);
  border-left: 2px solid color-mix(in oklab, var(--accent) 55%, transparent);
  color: var(--text-secondary);
  font-size: var(--fs-body);
  line-height: 1.5;
  text-wrap: pretty;
}

/* The logo callout: a small title over a row of white marks, no boxes. The
   marks keep microsite.css's white filter and per-logo optical scales; only
   the height is set here, smaller than the hero row they came from. */
.fx-aside--logos { padding-block: .1em; }
/* Title and marks share the aside's grey (--text-secondary, #A1A1A1), so the
   callout sits as quietly as the Personalize one. invert(.63) is the white
   filter stopped short: it lands the marks on that same grey. */
.fx-aside-title {
  margin: 0 0 var(--space-s);
  color: var(--text-secondary);
  font-size: var(--fs-body);
  font-weight: 400;
}
.fx-aside-logos { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-s) clamp(22px, 2.3vw, 34px); }
.fx-aside-logos .integration-logo {
  width: auto;
  height: calc(clamp(15px, 1.35vw, 19px) * var(--integration-logo-scale, 1));
  transform: none;
  filter: brightness(0) invert(.63);
  opacity: 1;
}
/* At this small size the shared scales are not enough: Google Drive and
   Dropbox set their wordmark small beside a large icon, so they read
   undersized next to OneDrive's big wordmark. These even them out. */
.fx-aside-logos .integration-logo--google-drive { --integration-logo-scale: 1.3; }
.fx-aside-logos .integration-logo--dropbox { --integration-logo-scale: 1.35; }
.fx-aside-logos .integration-logo--box { --integration-logo-scale: .9; }
.fx-aside-logos .integration-logo--onedrive { --integration-logo-scale: .8; }

@media (max-width: 900px) {
  .fx-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
  .fx-copy { max-width: 40rem; }
}

/* ───────── the frame: gradient, orbs ───────── */
.fx-visual {
  --fx-c1: var(--fx-blue);
  --fx-c2: var(--fx-cyan);
  --fx-c3: var(--fx-purple);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 6 / 5;
  border: 1px solid var(--border-subtle);
  border-radius: clamp(18px, 2.2vw, 28px);
  container-type: inline-size;
  background:
    radial-gradient(110% 85% at 0% 0%, color-mix(in oklab, var(--fx-c1) 42%, transparent), transparent 62%),
    radial-gradient(95% 80% at 100% 100%, color-mix(in oklab, var(--fx-c2) 38%, transparent), transparent 64%),
    linear-gradient(155deg, #1a2130, #0d0f14 70%);
}
.fx-visual--automate { --fx-c1: var(--fx-purple); --fx-c2: var(--fx-blue); --fx-c3: var(--fx-cyan); }
.fx-visual--sync { --fx-c1: var(--fx-cyan); --fx-c2: var(--fx-green); --fx-c3: var(--fx-blue); }

.fx-orb {
  position: absolute;
  z-index: -1;
  width: 52cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(9cqw);
  opacity: .55;
  pointer-events: none;
}
.fx-orb--a { top: -14cqw; left: -10cqw; background: var(--fx-c1); }
.fx-orb--b { right: -16cqw; bottom: -18cqw; background: var(--fx-c2); }
.fx-orb--c { top: 30cqw; left: 34cqw; width: 34cqw; background: var(--fx-c3); opacity: .35; }

@media (prefers-reduced-motion: no-preference) {
  .fx-orb--a { animation: fxDriftA 19s ease-in-out infinite alternate; }
  .fx-orb--b { animation: fxDriftB 23s ease-in-out infinite alternate; }
  .fx-orb--c { animation: fxDriftC 17s ease-in-out infinite alternate; }
  /* Off screen, the drift and the skeleton shimmer hold still. */
  .fx-visual:not(.is-playing) .fx-orb,
  .fx-visual:not(.is-playing) .fx-sk { animation-play-state: paused; }
}
@keyframes fxDriftA { to { transform: translate(14cqw, 9cqw); } }
@keyframes fxDriftB { to { transform: translate(-12cqw, -10cqw); } }
@keyframes fxDriftC { to { transform: translate(-16cqw, 6cqw) scale(1.25); } }

/* ───────── the UI layer ───────── */
.fx-ui {
  position: absolute;
  inset: 6cqw 5cqw;
  font-family: var(--font-body);
  font-size: 2.05cqw;
  line-height: 1.35;
  color: var(--text-primary);
}
.fx-split {
  display: grid;
  grid-template-columns: 40% minmax(0, 1fr);
  align-items: center;
  gap: 3cqw;
}
.fx-panel {
  position: relative;
  padding: 1.3em;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 1.1em;
  background: color-mix(in oklab, #0b0d12 74%, transparent);
  box-shadow: 0 2em 4em -1.6em rgba(0, 0, 0, .7);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.fx-stack { display: flex; flex-direction: column; gap: .4em; min-width: 0; }
.fx-label {
  display: block;
  margin: 1.1em 0 .5em;
  color: var(--text-secondary);
  font-size: .72em;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Skeleton bars, the "still loading" parts of the UI. A soft shimmer runs
   across them so the picture reads as live product, not a drawing. */
.fx-sk {
  display: block;
  flex: none;
  height: .62em;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--fx-sk) 0%, rgba(255, 255, 255, .18) 50%, var(--fx-sk) 100%) 0 0 / 300% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .fx-sk { animation: fxShimmer 2.8s linear infinite; }
}
@keyframes fxShimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }
.fx-w30 { width: 30%; } .fx-w40 { width: 40%; } .fx-w50 { width: 50%; } .fx-w60 { width: 60%; }
.fx-w70 { width: 70%; } .fx-w80 { width: 80%; } .fx-w90 { width: 90%; }

/* the S-Docs mark: the logo's five colours in one tile */
.fx-mark {
  flex: none;
  width: 1.5em;
  height: 1.5em;
  border-radius: .4em;
  background: conic-gradient(from 200deg, #e9522a, #f1b734, #91bc70, #71ade2, #9180c8, #e9522a);
}

/* ───────── the HubSpot record ───────── */
.fx-record-head { display: flex; align-items: center; gap: .8em; }
.fx-avatar {
  flex: none;
  width: 2.5em;
  height: 2.5em;
  border-radius: .7em;
  background: linear-gradient(140deg, #ff9b80, #ff5e39);
}
.fx-name { font-size: 1.1em; font-weight: 500; letter-spacing: -.01em; }
.fx-prop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8em;
  margin: 0 -.6em;
  padding: .5em .6em;
  border-radius: .5em;
  font-size: .95em;
}
.fx-prop + .fx-prop { border-top: 1px solid var(--fx-line); }
.fx-prop-k { color: var(--text-secondary); }
.fx-prop-v { font-weight: 500; white-space: nowrap; }
.fx-source {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  margin-top: 1em;
  padding: .4em .8em .4em .55em;
  border: 1px dashed rgba(255, 255, 255, .2);
  border-radius: 99px;
  color: var(--text-secondary);
  font-size: .82em;
}
/* the logos are black wordmarks; turned white like the hero's logo row */
.fx-source img { width: auto; height: 1.05em; filter: brightness(0) invert(1); opacity: .85; }

/* ───────── the document ───────── */
.fx-doc {
  display: flex;
  flex-direction: column;
  gap: .75em;
  background: color-mix(in oklab, #1b2130 82%, transparent);
}
.fx-doc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .3em; }
.fx-doc-title { font-size: 1.45em; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }

/* A merge field: the token and the value it resolves to share one grid
   cell. Finished, only the value shows. */
.fx-merge { display: inline-grid; justify-self: start; align-self: flex-start; }
.fx-merge > * { grid-area: 1 / 1; }
.fx-merge--end { margin-left: auto; justify-items: end; }
.fx-token {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85em;
  color: var(--fx-cyan);
  opacity: 0;
  white-space: nowrap;
}
.fx-value {
  padding: .1em .35em;
  margin: -.1em -.35em;
  border-radius: .3em;
  color: color-mix(in oklab, var(--fx-cyan) 55%, var(--text-primary));
  font-weight: 500;
  white-space: nowrap;
}
.fx-table { border-top: 1px solid var(--fx-line); }
.fx-tr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: .55em 0;
  border-bottom: 1px solid var(--fx-line);
}
.fx-row-name { color: var(--text-secondary); }
.fx-tr--sheet .fx-value { color: color-mix(in oklab, var(--fx-green) 70%, var(--text-primary)); }
.fx-doc-foot { display: flex; align-items: center; justify-content: space-between; }
.fx-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: .4em;
  margin-top: .3em;
  padding: .4em .85em .4em .6em;
  border-radius: 99px;
  background: color-mix(in oklab, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: .85em;
  font-weight: 500;
}
.fx-badge svg, .fx-seal svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ───────── 2 · the object picker and the workflow ───────── */
.fx-split--flow { grid-template-columns: 34% minmax(0, 1fr); }
.fx-objects { display: flex; flex-direction: column; gap: .2em; }
.fx-objects .fx-label { margin-top: 0; }
.fx-obj {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5em .7em;
  border: 1px solid transparent;
  border-radius: .55em;
  color: var(--text-secondary);
  font-size: .95em;
}
.fx-obj em {
  padding: .1em .5em;
  border-radius: 99px;
  background: color-mix(in oklab, var(--fx-purple) 28%, transparent);
  color: color-mix(in oklab, var(--fx-purple) 45%, var(--text-primary));
  font-size: .78em;
  font-style: normal;
}
/* the selected object; the script walks this from Deals to Tickets to a
   custom object */
.fx-obj.is-final {
  border-color: color-mix(in oklab, var(--fx-purple) 55%, transparent);
  background: color-mix(in oklab, var(--fx-purple) 18%, transparent);
  color: var(--text-primary);
}

.fx-flow { display: flex; flex-direction: column; }
.fx-flow-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2em; }
.fx-toggle { display: inline-flex; align-items: center; gap: .45em; color: var(--text-secondary); font-size: .8em; }
.fx-toggle i {
  position: relative;
  width: 2em;
  height: 1.1em;
  border-radius: 99px;
  background: color-mix(in oklab, var(--fx-green) 70%, transparent);
}
.fx-toggle i::after {
  content: '';
  position: absolute;
  top: .15em;
  right: .15em;
  width: .8em;
  height: .8em;
  border-radius: 50%;
  background: #fff;
}
.fx-node {
  display: flex;
  align-items: center;
  gap: .8em;
  padding: .85em 1em;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: .8em;
  background: rgba(255, 255, 255, .04);
}
.fx-node-text { font-weight: 500; }
.fx-node--trigger {
  flex-direction: column;
  align-items: flex-start;
  gap: .2em;
  border-color: color-mix(in oklab, var(--accent) 45%, transparent);
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}
.fx-node--trigger .fx-label { margin: 0; color: var(--accent); }
.fx-swap { display: inline-grid; color: color-mix(in oklab, var(--fx-purple) 45%, var(--text-primary)); }
.fx-swap > * { grid-area: 1 / 1; }
.fx-swap > :not(.is-final) { opacity: 0; }
.fx-wire {
  display: block;
  width: 2px;
  height: 1.5em;
  margin-left: 1.9em;
  background: rgba(255, 255, 255, .2);
  transform-origin: top;
}
/* The pulse rides the wires. Its left edge lines up with them: the panel's
   padding, the wire's inset, and half its own width back. */
.fx-pulse {
  position: absolute;
  top: 34%;
  left: calc(1.3em + 1.9em + 1px - .4em);
  width: .8em;
  height: .8em;
  border-radius: 50%;
  background: var(--fx-cyan);
  box-shadow: 0 0 0 .3em color-mix(in oklab, var(--fx-cyan) 25%, transparent), 0 0 1.4em var(--fx-cyan);
  opacity: 0;
}

/* ───────── 3 · signed, filed, synced ───────── */
.fx-split--sync {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.fx-fields { display: flex; gap: .5em; margin-top: .3em; }
.fx-field {
  flex: 1;
  padding: .45em .6em;
  border: 1px solid color-mix(in oklab, var(--fx-cyan) 40%, transparent);
  border-radius: .4em;
  background: color-mix(in oklab, var(--fx-cyan) 7%, transparent);
  font-size: .85em;
  white-space: nowrap;
}
.fx-sign { margin-top: .4em; }
.fx-signature { display: block; width: 62%; height: auto; overflow: visible; }
.fx-signature path { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fx-sign-line { display: block; height: 1px; background: rgba(255, 255, 255, .22); }
.fx-seal {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: .4em;
  padding: .35em .8em .35em .55em;
  border-radius: 99px;
  background: color-mix(in oklab, var(--fx-green) 18%, transparent);
  color: color-mix(in oklab, var(--fx-green) 70%, var(--text-primary));
  font-size: .85em;
  font-weight: 500;
}
/* the PDF chip that carries the signed copy across to the record */
.fx-flyer {
  position: absolute;
  z-index: 2;
  top: 40%;
  left: 36%;
  padding: .5em .75em;
  border-radius: .45em;
  background: var(--accent);
  color: #141416;
  font-size: .8em;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: 0 .8em 2em -.6em rgba(0, 0, 0, .8);
  opacity: 0;
}
.fx-stage { display: inline-grid; justify-self: start; }
.fx-stage > * {
  grid-area: 1 / 1;
  justify-self: start;
  padding: .15em .65em;
  border-radius: 99px;
  background: rgba(255, 255, 255, .1);
  color: var(--text-secondary);
  font-size: .78em;
  white-space: nowrap;
}
.fx-stage > .is-final {
  background: color-mix(in oklab, var(--fx-green) 22%, transparent);
  color: color-mix(in oklab, var(--fx-green) 70%, var(--text-primary));
}
.fx-stage > :not(.is-final) { opacity: 0; }
.fx-file {
  display: flex;
  align-items: center;
  gap: .7em;
  margin: 1.1em 0 .6em;
  padding: .6em;
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  border-radius: .6em;
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}
.fx-file-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.3em;
  height: 2.7em;
  border-radius: .35em;
  background: var(--accent);
  color: #141416;
  font-size: .7em;
  font-weight: 700;
}
.fx-file-name { font-size: .9em; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Narrow frames (a phone): the same picture, a little larger type and a
   squarer frame so the UI keeps some breathing room. */
@container (max-width: 520px) {
  .fx-ui { inset: 5cqw 4.5cqw; font-size: 2.35cqw; }
}
@media (max-width: 520px) {
  .fx-visual { aspect-ratio: 1 / 1.02; }
}

/* ───────── demo band ─────────
   The ask between the three features and the AI section, on
   /homepage-v2. Open on the page ground like the Integrations and AI
   sections, no card: a hairline across the frame (the integrations grid's
   line), the headline on the left at section size with the button under
   it, and on the right, in a column wide enough to hold it to three lines,
   a grey line on what the demo shows, level with the headline's top.
   Stacked under 900px: headline, the grey line, then the button. */
.demo-band { padding-block: 0 var(--rhythm-end); }
.demo-band-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 38rem);
  align-items: start;
  gap: var(--space-xl) var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid color-mix(in oklab, var(--text-primary) 20%, transparent);
}
.demo-band-main { display: flex; flex-direction: column; align-items: flex-start; }
.demo-band-title { margin: 0; }
.demo-band-sub {
  margin: 0;
  color: var(--text-secondary);
  text-wrap: pretty;
}
.demo-band-cta { margin-top: var(--space-l); }
@media (max-width: 900px) {
  .demo-band-row { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-m); }
  .demo-band-main { display: contents; }
  .demo-band-sub { order: 1; }
  .demo-band-cta { order: 2; justify-self: start; margin-top: var(--space-2xs); }
}
