/* ============================================================
   10-cust — Customer stories index.
   Everything scoped to .cst-*. Tokens only; the single raw value
   allowed anywhere here is a 1px hairline.
   ============================================================ */

/* ---------------- Hero ----------------
   The nav is transparent white-on-dark until it scrolls, so the first
   section on every page has to be dark. Same family as pg-hero: layered
   radial wash, diagonal foot cutting into the white below. */

.cst-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* nav is sticky with zero flow height — clear it explicitly */
  padding-block: calc(var(--s-11) + var(--section-y)) var(--s-13);
}

.cst-hero__wash {
  position: absolute;
  inset: -20% -10% -30%;
  z-index: -1;
  background:
    radial-gradient(44% 56% at 14% 20%, color-mix(in srgb, var(--c-brand) 40%, transparent), transparent 70%),
    radial-gradient(36% 48% at 86% 8%, color-mix(in srgb, var(--c-cyan) 22%, transparent), transparent 72%),
    radial-gradient(52% 62% at 66% 92%, color-mix(in srgb, var(--c-magenta) 14%, transparent), transparent 74%),
    var(--grad-dark);
}

/* The wedge is rotated about its bottom-left corner, so its lower edge climbs
   ~42px across a 104%-wide box. It has to start far enough below the section
   for that climb to stay clipped — otherwise a hairline of the dark hero
   survives under the wedge on the right-hand side. */
.cst-hero::after {
  content: "";
  position: absolute;
  inset-inline: -2%;
  bottom: calc(var(--s-10) * -1);
  height: var(--s-13);
  background: var(--surface);
  transform: rotate(-1.6deg);
  transform-origin: bottom left;
}

.cst-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--s-9);
}

.cst-hero__t {
  margin-block-start: var(--s-4);
  max-width: 16ch;
  color: var(--text-invert);
}

.cst-hero__lead {
  margin-block-start: var(--s-6);
  max-width: 58ch;
}

/* The disclosure. Deliberately in the hero and deliberately legible —
   a prototype that hides its composites in a footnote has told a lie. */
.cst-hero__note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-4);
  align-items: start;
  padding: var(--s-5) var(--s-6);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--c-white) 6%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-white) 16%, transparent);
}

.cst-hero__note-ico {
  width: var(--s-6);
  height: var(--s-6);
  color: var(--c-teal);
}

.cst-hero__note-t {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-snug);
  color: var(--text-invert);
}

.cst-hero__note-b {
  margin-block-start: var(--s-2);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-invert-body);
}

.cst-hero__note-a {
  color: var(--c-teal);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
.cst-hero__note-a:hover { color: var(--c-lime); }

@media (min-width: 62em) {
  .cst-hero__inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--s-12);
    align-items: end;
  }
  .cst-hero__note { margin-block-end: var(--s-2); }
}

/* ---------------- Featured story ----------------
   No card, no border, no shadow. The quote is the only thing on its
   side of the page; the metrics get hairlines and nothing else. */

.cst-feat__inner {
  display: grid;
  gap: var(--s-10);
}

.cst-feat__mark {
  width: auto;
  height: var(--s-6);
  color: var(--text-strong);
}

.cst-feat__meta {
  margin-block-start: var(--s-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  letter-spacing: var(--tracking-snug);
}

.cst-feat__fig { margin: 0; }

.cst-feat__q {
  margin: var(--s-7) 0 0;
  max-width: 34ch;
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-snug);
  color: var(--text-strong);
  /* optical hang: the opening quote sits outside the measure so the
     first line's stem aligns with every line below it */
  text-indent: -0.42em;
}
.cst-feat__q p::before { content: "\201C"; }
.cst-feat__q p::after  { content: "\201D"; }

.cst-feat__by {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-block-start: var(--s-8);
}

.cst-feat__mono {
  flex: none;
  width: calc(var(--s-8) + var(--s-1));
  height: calc(var(--s-8) + var(--s-1));
  color: var(--c-brand);
}

.cst-feat__by-txt { display: block; }

.cst-feat__by-name {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  color: var(--text-strong);
  letter-spacing: var(--tracking-snug);
}

.cst-feat__by-role {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* -- metrics on hairlines -- */

.cst-feat__metrics { margin: 0; }

.cst-feat__metric {
  padding-block: var(--s-5);
  border-block-start: 1px solid var(--border);
}
.cst-feat__metric:last-child { border-block-end: 1px solid var(--border); }

.cst-feat__metric-l {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.cst-feat__metric-v {
  margin: var(--s-3) 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-3);
}

.cst-feat__num {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.cst-feat__delta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding-inline: var(--s-2);
  height: var(--s-6);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--c-brand) 9%, transparent);
  color: var(--c-brand-press);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
}
.cst-feat__delta svg { width: var(--s-3); height: var(--s-3); }

.cst-feat__metric-s {
  flex: 1 1 100%;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--text-body);
}

@media (min-width: 56em) {
  .cst-feat__inner {
    grid-template-columns: minmax(0, 62fr) minmax(0, 38fr);
    gap: var(--s-12);
    align-items: start;
  }
  .cst-feat__mark { height: var(--s-7); }
  .cst-feat__q { font-size: var(--fs-h3); max-width: 30ch; }
  /* the metric column starts on the quote's baseline block, not the wordmark's */
  .cst-feat__metrics { margin-block-start: var(--s-2); }
}

/* ---------------- Story grid ---------------- */

.cst-grid__head {
  display: grid;
  gap: var(--s-5);
  margin-block-end: var(--s-10);
}

.cst-grid__t { max-width: 18ch; }

.cst-grid__sub {
  max-width: 56ch;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-body);
}

@media (min-width: 56em) {
  .cst-grid__head {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--s-10);
    align-items: end;
  }
  .cst-grid__sub { padding-block-end: var(--s-1); }
}

.cst-grid__list {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

/* Non-interactive by design: there are no individual story pages yet, and a
   card that looks clickable but is not is worse than one that never claimed to
   be. No hover lift, no cursor change, no dead link. */
.cst-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: var(--s-4);
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--c-hairline), var(--sh-xs);
}

.cst-card__mark {
  width: auto;
  height: var(--s-5);
  color: var(--text-strong);
}

.cst-card__seg {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.cst-card__metric {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--c-brand);
  font-variant-numeric: tabular-nums;
}

.cst-card__metric-u {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-normal);
  color: var(--text-muted);
}

.cst-card__find {
  padding-block-start: var(--s-4);
  border-block-start: 1px solid var(--c-hairline-soft);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-body);
}

/* ---------------- Results table ---------------- */

.cst-tbl__head {
  display: grid;
  gap: var(--s-5);
  margin-block-end: var(--s-9);
}

.cst-tbl__t { max-width: 16ch; }

.cst-tbl__sub {
  max-width: 56ch;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-body);
}

@media (min-width: 56em) {
  .cst-tbl__head {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--s-10);
    align-items: end;
  }
  .cst-tbl__sub { padding-block-end: var(--s-1); }
}

/* Keyboard-scrollable region: a table that only a mouse can pan is a trap. */
.cst-tbl__scroll { overflow-x: auto; }

.cst-tbl__table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  text-align: start;
}

.cst-tbl__cap {
  padding-block-end: var(--s-5);
  text-align: start;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.cst-tbl__th {
  padding: 0 var(--s-5) var(--s-3) 0;
  border-block-end: 1px solid var(--c-navy);
  text-align: start;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-strong);
  white-space: nowrap;
}
.cst-tbl__th--n { text-align: end; }

.cst-tbl__rh,
.cst-tbl__n,
.cst-tbl__op {
  padding: var(--s-5) var(--s-5) var(--s-5) 0;
  border-block-end: 1px solid var(--c-hairline);
  vertical-align: baseline;
}

.cst-tbl__rh {
  text-align: start;
  font-size: var(--fs-body);
  font-weight: var(--fw-semi);
  color: var(--text-strong);
  letter-spacing: var(--tracking-snug);
  white-space: nowrap;
}

.cst-tbl__n {
  text-align: end;
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-body);
  color: var(--text-body);
  white-space: nowrap;
}
.cst-tbl__n--after {
  font-weight: var(--fw-semi);
  color: var(--c-brand-press);
}

.cst-tbl__op {
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--text-body);
  padding-inline-end: 0;
}

.cst-tbl__table tbody tr:last-child .cst-tbl__rh,
.cst-tbl__table tbody tr:last-child .cst-tbl__n,
.cst-tbl__table tbody tr:last-child .cst-tbl__op { border-block-end: 0; }

/* ---------------- Closing CTA ---------------- */

.cst-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.cst-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 90% at 78% 6%, color-mix(in srgb, var(--c-brand) 34%, transparent), transparent 72%),
    radial-gradient(46% 80% at 6% 100%, color-mix(in srgb, var(--c-cyan) 16%, transparent), transparent 74%);
}

.cst-cta__inner { max-width: 44rem; }

.cst-cta__t {
  max-width: 18ch;
  color: var(--text-invert);
}

.cst-cta__lead {
  margin-block-start: var(--s-5);
  max-width: 52ch;
}

.cst-cta__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-block-start: var(--s-8);
}
