/* ==========================================================================
   LattIQ — "What you get" capability pills
   One component for all four solution pages. Static, no build step.

   LAYOUT FRAMEWORK
   Every pill is exactly one column wide — all pills in a section share the
   same width, always. Two variables govern the grid:
     --lq-cap   columns per row (4 on desktop; stepped down by container
                queries to 3 / 2 / 1 as the section narrows)
     --lq-gap   gutter
   Pills do not grow to absorb leftover space, so a row of three next to a row
   of four looks like the same object, not a stretched one. Partial rows are
   centred, which turns 7 items into a clean 4 + 3 instead of a ragged
   left-aligned tail, and 8 items into 4 + 4.
   Per-page overrides: .lq-caps--cap-2 / --cap-3 / --cap-5, --compact, --wide.

   MOBILE
   Below 660px the section collapses to its first four pills plus a
   "+ N more" pill that expands the full list and then offers "Show less".
   Requires lattiq-capabilities.js (12 lines, no dependencies). Without the
   script the list simply renders in full — no broken state.

   MARKUP CONTRACT
   .lq-caps.lq-caps--pill.lq-caps--compact
     > .lq-caps__eyebrow
     > .lq-caps__title
     > .lq-caps__grid[data-lq-collapsible]
         > .lq-caps__cell   (tile + label)          × n
         > a.lq-caps__more                          (optional)
         > button.lq-caps__more.lq-caps__toggle     (optional, mobile only)
   Variants: --pill (chosen) | --pill --compact | --onglass | --rows
   ========================================================================== */

.lq-caps {
  container-type: inline-size;
  --lq-cap: 4;
  --lq-gap: 10px;
  --lq-tile: 32px;
  --lq-r: 2px;               /* sharp corners — brand UI chrome */
  --lq-tile-r: 2px;
  --lq-line: #E8EEF2;
  --lq-ink: #0A1F18;
  --lq-ink-2: #46615A;
  --lq-primary: #169C76;
  --lq-deep: #0A5440;
  --lq-pale: #C8FBE6;
  font-family: "Geist", "Geist Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #fff;
}
.lq-caps *, .lq-caps *::before, .lq-caps *::after { box-sizing: border-box; }

.lq-caps__eyebrow {
  margin: 0 0 14px;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lq-pale);
}
.lq-caps__title {
  margin: 0 0 28px;
  font-size: clamp(24px, 3.1cqw, 36px);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 700;
  color: #fff;
  text-wrap: balance;
  max-width: 22ch;
}

/* ---------------------------  the framework  ----------------------------- */
.lq-caps__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;   /* partial rows sit centred */
  gap: var(--lq-gap);
}
.lq-caps__cell,
.lq-caps__more {
  /* one column wide — no grow, no shrink, so every pill matches */
  flex: 0 0 calc((100% - (var(--lq-cap) - 1) * var(--lq-gap)) / var(--lq-cap));
  min-width: 0;
}
.lq-caps--cap-2 { --lq-cap: 2; }
.lq-caps--cap-3 { --lq-cap: 3; }
.lq-caps--cap-5 { --lq-cap: 5; }
.lq-caps--compact { --lq-gap: 8px; --lq-tile: 28px; }
.lq-caps--wide    { --lq-cap: 2; }   /* sentence-length labels (risk-teams) */

/* column steps — container-based, so the section reflows correctly inside any
   column width, not just at viewport widths */
@container (max-width: 940px) { .lq-caps .lq-caps__grid { --lq-cap: 3; } }
@container (max-width: 660px) { .lq-caps .lq-caps__grid { --lq-cap: 2; } }
@container (max-width: 470px) { .lq-caps .lq-caps__grid { --lq-cap: 1; } }
.lq-caps--wide  .lq-caps__grid { --lq-cap: 2; }
@container (max-width: 660px) { .lq-caps--wide .lq-caps__grid { --lq-cap: 1; } }

/* ---------------------------  shared parts  ------------------------------ */
.lq-caps__tile {
  flex: 0 0 auto;
  width: var(--lq-tile);
  height: var(--lq-tile);
  border-radius: var(--lq-tile-r);
  background: linear-gradient(150deg, var(--lq-primary), var(--lq-deep));
  color: #fff;
  display: grid;
  place-items: center;
}
.lq-caps__tile svg { width: 17px; height: 17px; display: block; }
.lq-caps--compact .lq-caps__tile svg { width: 15px; height: 15px; }
.lq-caps__label {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -.01em;
  color: var(--lq-ink);
  text-wrap: pretty;
}
.lq-caps--compact .lq-caps__label { font-size: 14px; }
.lq-caps__desc {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--lq-ink-2);
}
.lq-caps__arrow { width: 17px; height: 17px; flex: 0 0 auto; transition: transform .2s cubic-bezier(.4,0,.2,1); }
.lq-caps__more { text-decoration: none; font: inherit; text-align: left; cursor: pointer; }
.lq-caps__more:hover .lq-caps__arrow { transform: translateX(3px); }
.lq-caps__chev { width: 17px; height: 17px; flex: 0 0 auto; transition: transform .2s cubic-bezier(.4,0,.2,1); }
.lq-caps__grid[data-lq-collapsed="false"] .lq-caps__chev { transform: rotate(180deg); }

/* =========================  A — sharp pill  ============================== */
.lq-caps--pill .lq-caps__cell,
.lq-caps--pill .lq-caps__more {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 13px 16px;
  background: #fff;
  border: 1px solid var(--lq-line);
  border-radius: var(--lq-r);
  box-shadow: 0 10px 22px -16px rgba(4, 33, 27, .55);
  transition: box-shadow .2s cubic-bezier(.4,0,.2,1), transform .2s cubic-bezier(.4,0,.2,1);
}
.lq-caps--pill .lq-caps__cell:hover,
.lq-caps--pill .lq-caps__more:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px -18px rgba(4, 33, 27, .7);
}
.lq-caps--pill .lq-caps__more {
  justify-content: space-between;
  background: #EEFBF5;
  border-color: #C8FBE6;
  color: #0E7256;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.lq-caps--pill.lq-caps--compact .lq-caps__cell,
.lq-caps--pill.lq-caps--compact .lq-caps__more {
  min-height: 54px;
  padding: 10px 13px;
  gap: 10px;
  box-shadow: 0 6px 14px -12px rgba(4, 33, 27, .5);
}
.lq-caps--pill.lq-caps--compact .lq-caps__more { font-size: 14px; }

/* ===========================  B — on glass  ============================== */
.lq-caps--onglass .lq-caps__cell,
.lq-caps--onglass .lq-caps__more {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: var(--lq-r);
  transition: background .2s cubic-bezier(.4,0,.2,1), border-color .2s;
}
.lq-caps--onglass .lq-caps__cell:hover,
.lq-caps--onglass .lq-caps__more:hover {
  background: rgba(255, 255, 255, .17);
  border-color: rgba(255, 255, 255, .34);
}
.lq-caps--onglass .lq-caps__tile { background: rgba(255, 255, 255, .16); }
.lq-caps--onglass .lq-caps__label { color: #fff; }
.lq-caps--onglass .lq-caps__desc { color: rgba(255, 255, 255, .72); }
.lq-caps--onglass .lq-caps__more {
  justify-content: space-between;
  border-style: dashed;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

/* ========================  C — index rows  =============================== */
.lq-caps--rows { --lq-cap: 2; --lq-gap: 0 56px; --lq-tile: 28px; }
.lq-caps--rows .lq-caps__grid { justify-content: flex-start; counter-reset: lqcap; }
@container (max-width: 660px) { .lq-caps--rows .lq-caps__grid { --lq-cap: 1; } }
.lq-caps--rows .lq-caps__cell,
.lq-caps--rows .lq-caps__more {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  transition: border-color .2s;
}
.lq-caps--rows .lq-caps__cell::before {
  counter-increment: lqcap;
  content: counter(lqcap, decimal-leading-zero);
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .5);
  width: 18px;
  flex: 0 0 auto;
}
.lq-caps--rows .lq-caps__cell:hover { border-color: rgba(255, 255, 255, .5); }
.lq-caps--rows .lq-caps__tile { background: rgba(255, 255, 255, .15); }
.lq-caps--rows .lq-caps__tile svg { width: 15px; height: 15px; }
.lq-caps--rows .lq-caps__label { color: #fff; }
.lq-caps--rows .lq-caps__desc { color: rgba(255, 255, 255, .7); }
.lq-caps--rows .lq-caps__more {
  justify-content: space-between;
  color: var(--lq-pale);
  font-size: 15px;
  font-weight: 600;
  border-bottom-color: rgba(255, 255, 255, .34);
}

/* ====================  mobile collapse / expand  =========================
   Desktop shows everything and hides the toggle. Below 660px the grid keeps
   its first four pills and the toggle takes over. Must come last — it
   deliberately overrides the variant display rules. */
.lq-caps .lq-caps__toggle { display: none; }

@container (max-width: 660px) {
  .lq-caps__title { margin-bottom: 20px; }
  .lq-caps--pill .lq-caps__cell,
  .lq-caps--pill .lq-caps__more { min-height: 56px; padding: 11px 14px; }
  .lq-caps__label { font-size: 14.5px; }

  .lq-caps .lq-caps__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-basis: 100%;
  }
  .lq-caps__grid[data-lq-collapsed="true"] > .lq-caps__cell:nth-child(n+5),
  .lq-caps__grid[data-lq-collapsed="true"] > a.lq-caps__more { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lq-caps *, .lq-caps *::before { transition: none !important; }
}

/* Optional: the solution-page green band, for standalone previews.
   The live site already paints this via .metrics-and-cards-wrap. */
.lq-band {
  background: linear-gradient(165deg, #0C6A50 0%, #169C76 50%, #10825F 100%);
  padding: 60px 44px;
}

/* ===== Aug 7 tweaks ===== */
/* Centered "Use cases" eyebrow with a little more breathing room */
.lq-caps__eyebrow { text-align: center; margin-bottom: 22px; }
/* Classier frosted-glass pills (subtle, still readable on the green band) */
.lq-caps--pill .lq-caps__cell {
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  backdrop-filter: blur(10px) saturate(1.15);
  border-color: rgba(255, 255, 255, .5);
  box-shadow: 0 10px 24px -16px rgba(4, 33, 27, .5), inset 0 1px 0 rgba(255, 255, 255, .65);
}
.lq-caps--pill .lq-caps__cell:hover {
  background: rgba(240, 253, 249, .92);
  border-color: rgba(255, 255, 255, .8);
}
/* "+ many more" scrolls to the page's demo section — offset for the fixed nav + smooth */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
[id="demo"] { scroll-margin-top: 92px; }

/* Separation between the "Use cases" pills and the following content block
   ("Everything ... in one platform"). Scoped via the adjacency, so it applies
   only where the pills are present (ds / marketers / enterprises), not risk-teams. */
.lq-caps + .mwyg-wyg-title{ margin-top: clamp(46px, 5.5vw, 78px); }
