/* /what-we-build/segments: the second capability page. Layers on top of
   base.css.

   Section order matches src/views/what-we-build-segments.ejs and the
   capability-page structure in SITE-ARCHITECTURE.md section 5.

   Deliberately close to build.ranking.css. The two capability pages
   should read as the same page type, so the hero, the settles grid, the
   dark two-column split, the onward cards and the closing block are the
   same shapes at the same sizes. Where a rule here is identical to one
   there, that is on purpose and not a copy-paste to be factored out:
   they are separate pages and either can move without dragging the other.

   The genuinely new component is the group card, which carries a figure
   panel and a published rule. It is a card rather than a table row
   because a group's rule runs to forty words and a table would set it at
   a size nobody reads. */

/* ── Hero ───────────────────────────────────────────────────────── */

.sg-hero { padding: 70px 0 76px; }

.sg-hero h1 .line { display: block; }
.sg-hero h1 .line + .line { margin-top: 0.1em; }

.sg-hero h1 {
  font-size: clamp(33px, 4.5vw, 57px);
  max-width: 21em;
}

.sg-hero-lede { font-size: 19.5px; max-width: 38em; }

/* Shared measure for a paragraph sitting under a section headline. */
.sg-measure { max-width: 40em; }

/* ── What this settles ──────────────────────────────────────────── */

.sg-settles h2 { max-width: 16em; }
.sg-settles-grid { margin-top: 42px; }

@media (min-width: 901px) {
  .sg-settles-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── What it looks like ─────────────────────────────────────────── */

.sg-looks h2 { max-width: 16em; }

.sg-looks-list {
  margin-top: 40px;
  display: grid;
  gap: 30px;
  max-width: 46em;
}

.sg-looks-item {
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.sg-looks-item h3 { margin-bottom: 8px; }

.sg-looks-item p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--body);
}

/* The panel separating this from the industry and size split they
   already have. */
.sg-distinction {
  margin-top: 40px;
  max-width: 46em;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 24px 26px;
}

.sg-distinction p {
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--body);
}

/* ── A group is only real if it behaves differently ─────────────── */

.sg-real { padding: 78px 0 84px; }
.sg-real h2 { max-width: 13em; }
.sg-real .lede + .lede { margin-top: 18px; }

.sg-real-grid {
  margin-top: 44px;
  display: grid;
  gap: 34px;
  max-width: 52em;
}

@media (min-width: 761px) {
  .sg-real-grid { grid-template-columns: 1fr 1fr; gap: 44px; }
}

.sg-real-col { padding-top: 18px; border-top: 1px solid var(--rule-dark); }

.sg-real-label {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}

.sg-real-col p {
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--dark-body);
}

.sg-real-pointer {
  margin-top: 40px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 17px;
  color: #FFFFFF;
}

/* ── The four groups ────────────────────────────────────────────── */

.sg-groups h2 { max-width: 15em; }

/* Run metadata. Instrument type: chrome reporting what the run was. */
.sg-run {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.sg-run span { margin: 0 6px; color: var(--rule); }

.sg-cards {
  margin-top: 30px;
  display: grid;
  gap: 20px;
}

/* Two up from 901px rather than four: four across would set the
   published rule at caption size, and the rule is the thing that makes
   the group checkable. */
@media (min-width: 901px) {
  .sg-cards { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}

.sg-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 26px 28px 28px;
  display: flex;
  flex-direction: column;
}

.sg-card-stage {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.sg-card-head h3 {
  margin-bottom: 9px;
  text-wrap: balance;
}

.sg-card-plain {
  font-size: 16px;
  line-height: 1.58;
  color: var(--body);
}

/* The figure panel. Counts sit on one row as plain numerals; fit and
   timing take bars underneath, always separately and never averaged. */
.sg-stats {
  margin: 22px 0 0;
  padding: 18px 0 2px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 14px;
}

.sg-stat dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.sg-stat-num {
  font-family: var(--mono);
  font-size: 19px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* The two score rows span the full width so both bars share a left edge
   and the same scale, which is what makes 48 above 57 readable. */
.sg-stat-score {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Wide enough to hold "Mean timing" on one line. Below that it wraps to
   two and the two score rows stop sharing a baseline. */
.sg-stat-score dt { margin-bottom: 0; flex: 0 0 auto; width: 90px; }
.sg-stat-score dd { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; }

.sg-stat-score .sg-stat-num { font-size: 14px; min-width: 24px; text-align: right; }

.sg-bar {
  display: block;
  flex: 1 1 auto;
  height: 5px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
}

/* One fill color for both scores: a second color would imply the two
   measure things of different kinds. */
.sg-bar-fill { display: block; height: 100%; background: var(--teal); }

/* The published rule. Tinted ground so it reads as quoted material
   rather than as our sentence about the group. */
.sg-rule {
  margin-top: 22px;
  background: var(--tint);
  border-radius: 10px;
  padding: 16px 18px;
}

.sg-rule-label,
.sg-topics-label {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.sg-rule p {
  font-size: 14.5px;
  line-height: 1.58;
  color: var(--body);
}

.sg-topics { margin-top: 22px; }

.sg-topics ul { list-style: none; margin: 0; padding: 0; }

.sg-topics li {
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--body);
}

.sg-topics li + li { margin-top: 9px; }

/* A hairline dash rather than a bullet or a check: these are subjects,
   not findings, and teal here would claim they were verified. */
.sg-topics li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 1px;
  background: var(--slate);
}

.sg-topics-note,
.sg-provisional {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 44em;
}

.sg-provisional { margin-top: 8px; }

/* ── What the column shows ──────────────────────────────────────── */

/* Deliberately quiet. This is the page's one paragraph about the
   inversion and it is not the page's argument, so it gets a single
   measure of text on the tint and no panel, no figure and no rule. */
.sg-read-inner { max-width: 44em; }
.sg-read h2 { max-width: 14em; }
.sg-read .lede { margin-top: 16px; }

.sg-read-link {
  display: inline-block;
  margin-top: 22px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--teal-deep);
  text-decoration: none;
}

.sg-read-link span,
.sg-onward-link span {
  display: inline-block;
  margin-left: 5px;
  transition: transform 160ms ease;
}

.sg-read-link:hover span,
.sg-onward-link:hover span { transform: translateX(3px); }

/* ── Two that work with it ──────────────────────────────────────── */

.sg-onward h2 { max-width: 14em; }
.sg-onward-grid { margin-top: 38px; }

@media (min-width: 901px) {
  .sg-onward-grid { grid-template-columns: repeat(2, 1fr); }
}

.sg-onward-link {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--teal-deep);
  text-decoration: none;
}

/* ── Closing ────────────────────────────────────────────────────── */

.sg-cta-inner { text-align: center; }
.sg-cta h2 { max-width: 18em; margin: 0 auto; }

.sg-cta .lede {
  max-width: 40em;
  margin: 18px auto 0;
}

.sg-cta .actions { justify-content: center; }

/* ── Narrow ─────────────────────────────────────────────────────── */

/* The figure panel's three count columns crush below this. Two up keeps
   the numerals at a readable size, and the score rows already span the
   full width at every breakpoint. */
@media (max-width: 460px) {
  .sg-stats { grid-template-columns: repeat(2, 1fr); }
  .sg-card { padding: 22px 20px 24px; }
  .sg-stat-score dt { width: 68px; }
}

/* ── Motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .sg-read-link span,
  .sg-onward-link span { transition: none; }
}
