/* site.css — additive layer on top of foundation.css (docs/DESIGN.md §4). */

@font-face {
  font-family: "Uncut Sans";
  src: url("/fonts/uncut-sans-variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Monaspace Xenon";
  src: url("/fonts/monaspace-xenon-variable.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

html {
  font-family: var(--font-sans, "Uncut Sans", system-ui, sans-serif);
  font-size: var(--text-base, 1.0625rem);
  color: var(--fg-body, #1a2026);
  background: var(--bg, #fafbfd);
  line-height: 1.6;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono, "Monaspace Xenon", ui-monospace, monospace);
  font-feature-settings: var(--ff-mono, "kern" 1, "liga" 0, "clig" 0, "calt" 0);
}

main {
  flex: 1;
  width: 100%;
  max-width: 74ch;
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem);
  box-sizing: border-box;
}

main h1 {
  font-size: clamp(1.75rem, 2.5vw + 1rem, 2.5rem);
  margin-top: 0;
  line-height: 1.15;
}
main h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
}
main h3 {
  font-size: 1.15rem;
  margin-top: 1.75rem;
}

main p,
main li {
  max-width: 70ch;
}
main pre {
  overflow-x: auto;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  position: relative;
  background: var(--bg-code, #f0f4f7);
  border: 1px solid var(--border, #cfd5db);
}
/* Positioning context for the copy button (added client-side by
 * clipboard.ts). The wrapper is non-scrolling and matches the pre's outer
 * width, so an `position: absolute` copy-button stays pinned to the right
 * edge of the visible block — it does not slide leftward when the pre is
 * horizontally scrolled to read long lines. The wrapper is invisible
 * (default block flow, no chrome) so it has no visual impact on the pre. */
main .code-wrap {
  position: relative;
}
main :not(pre) > code {
  background: var(--bg-code, #f0f4f7);
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  font-size: 0.95em;
}

/* Anchor permalinks (rehype-autolink-headings). Hidden until heading hover / focus. */
main a.anchor {
  color: var(--fg-muted, #525960);
  margin-left: 0.35rem;
  opacity: 0;
  transition: opacity 120ms linear;
  text-decoration: none;
}
main h1:hover .anchor,
main h1:focus-within .anchor,
main h2:hover .anchor,
main h2:focus-within .anchor,
main h3:hover .anchor,
main h3:focus-within .anchor,
main h4:hover .anchor,
main h4:focus-within .anchor,
main a.anchor:focus-visible {
  opacity: 1;
}
main .anchor-icon {
  vertical-align: -2px;
}

/* RFC-keyword color pairs (token definitions live in foundation.css). */
.rfc-must {
  color: var(--must, #af2b25);
}
.rfc-should {
  color: var(--should, #a16100);
}
.rfc-may {
  color: var(--may, #007980);
}

/* Block-level normative requirement (docs/DESIGN.md §4.7 block companion to
 * inline 7b). Wraps a `**KEYWORD:**` paragraph + the immediately-following
 * list in a single semantic aside. Container reads as a "spec callout":
 * tonal lift via --bg-raised, soft 8px corners, no side stripe (impeccable's
 * #1 banned pattern, even with semantic colors). The leading keyword
 * collapses from "sentence-leading bold word" to "caption-tier label" via
 * size/weight/tracking — same shift WHATWG/W3C TR specs use for normative
 * tags above the requirement body. Color stays semantic via the inherited
 * .rfc-must / .rfc-should / .rfc-may rules. */
.normative {
  margin-block: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  background: var(--bg-raised);
  max-inline-size: var(--measure);
}
.normative > p:first-child {
  margin: 0 0 0.5rem;
}
.normative > :last-child {
  margin-block-end: 0;
}
.normative > p:first-child > strong:first-child {
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
}

/* Shiki dual-theme CSS bridge (docs/DESIGN.md §4.6).
 * Scope `span` matching to Shiki's own syntax tokens (which live under
 * `<pre class="shiki"><code>…spans…</code></pre>`). The previous selector
 * `.shiki span` matched ANY descendant span, including the client-side-
 * injected `<span data-copy-label>` inside the copy-button — which then
 * inherited Shiki's dark-dimmed background (#22272e) and read as a light
 * grey pill on top of the button's intended dark `var(--bg)`. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shiki,
  :root:not([data-theme="light"]) .shiki code span {
    color: var(--shiki-dark);
    background-color: var(--shiki-dark-bg);
    font-style: var(--shiki-dark-font-style);
    font-weight: var(--shiki-dark-font-weight);
    text-decoration: var(--shiki-dark-text-decoration);
  }
}
:root[data-theme="dark"] .shiki,
:root[data-theme="dark"] .shiki code span {
  color: var(--shiki-dark);
  background-color: var(--shiki-dark-bg);
  font-style: var(--shiki-dark-font-style);
  font-weight: var(--shiki-dark-font-weight);
  text-decoration: var(--shiki-dark-text-decoration);
}

/* Skip link — only visible to keyboard users (§4.12 a11y). */
.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--accent, #0058aa);
  color: #fff;
  padding: 0.6rem 0.9rem;
  z-index: 100;
  text-decoration: none;
  border-radius: 0 0 0.4rem 0;
}
.skip-link:focus {
  left: 0;
  top: 0;
}

/* Header / brand / nav */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--border, #cfd5db);
}
.site-brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
  color: inherit;
}
.site-brand__name {
  font-weight: 600;
  letter-spacing: -0.01em;
}
.site-brand__tag {
  color: var(--fg-secondary, #6a7278);
  font-size: 0.9rem;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.95rem;
}
.site-nav a {
  color: inherit;
  white-space: nowrap;
}

/* Theme toggle — hidden when JS is off (C6). */
.theme-toggle {
  display: none;
  gap: 0;
  border: 1px solid var(--border, #cfd5db);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.85rem;
}
:root.js .theme-toggle {
  display: inline-flex;
}
.theme-toggle button {
  background: transparent;
  color: inherit;
  padding: 0.25rem 0.7rem;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.theme-toggle button[aria-pressed="true"] {
  background: var(--bg-code, #eef2f5);
  font-weight: 600;
}
.theme-toggle button + button {
  border-left: 1px solid var(--border, #cfd5db);
}

/* Copy buttons — hidden when JS is off (C6).
 *
 * Elevation: in light mode `--bg` (lightest gray, page bg) sits above the
 * pre's `--bg-code`, so the button reads as a raised pill. In dark mode the
 * scale inverts — `--bg` (oklch 14%) is BELOW Shiki's dark-dimmed pre bg
 * (#22272e ≈ oklch 21%), which would render the button as a recessed
 * darker rectangle. Override the dark-mode bg to `--border` (oklch 28%) so
 * the pill reads as intentionally raised in both themes. */
.copy-button {
  display: none;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg, #fff);
  color: inherit;
  border: 1px solid var(--border, #cfd5db);
  border-radius: 0.3rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .copy-button {
    background: var(--border, #2c333d);
  }
}
:root[data-theme="dark"] .copy-button {
  background: var(--border, #2c333d);
}
:root.js main .code-wrap .copy-button {
  display: inline-block;
}
.copy-button[data-copy-state="copied"] {
  background: var(--accent, #0058aa);
  color: #fff;
  border-color: var(--accent, #0058aa);
}

/* ================================================================
 * Homepage — hero + principle listing
 * ================================================================ */

/* Hero section — title + lede. The H1 breaks out of the default heading
   scale to create a clear "this is the landing page" signal. */
.hero {
  padding-top: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.hero__title {
  font-size: clamp(2.25rem, 3vw + 1.25rem, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 650;
  color: var(--fg-heading, #0f1419);
  margin: 0;
  animation: hero-enter 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero__lede {
  font-size: clamp(1.05rem, 0.9rem + 0.45vw, 1.2rem);
  line-height: 1.6;
  color: var(--fg-secondary, #6a7278);
  max-width: 62ch;
  margin: 1.25rem 0 0;
  animation: hero-enter 500ms cubic-bezier(0.16, 1, 0.3, 1) 80ms both;
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Principle listing — numbered entries linking to /p{N} pages. */
.principles-index {
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.principles-index__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.principle-entry {
  border-top: 1px solid var(--border-subtle, #e5e8eb);
  animation: principle-enter 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.principle-entry:last-child {
  border-bottom: 1px solid var(--border-subtle, #e5e8eb);
}

.principle-entry:nth-child(1) {
  animation-delay: 120ms;
}
.principle-entry:nth-child(2) {
  animation-delay: 170ms;
}
.principle-entry:nth-child(3) {
  animation-delay: 220ms;
}
.principle-entry:nth-child(4) {
  animation-delay: 270ms;
}
.principle-entry:nth-child(5) {
  animation-delay: 320ms;
}
.principle-entry:nth-child(6) {
  animation-delay: 370ms;
}
.principle-entry:nth-child(7) {
  animation-delay: 420ms;
}

@keyframes principle-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.principle-entry__link {
  display: grid;
  grid-template-columns: 3rem 1fr;
  grid-template-rows: auto auto;
  column-gap: 1.25rem;
  row-gap: 0.25rem;
  padding: 1.25rem 0.75rem;
  margin: 0 -0.75rem;
  text-decoration: none;
  color: inherit;
  border-radius: 0.375rem;
  transition: background-color 120ms ease;
}

.principle-entry__link:hover,
.principle-entry__link:focus-visible {
  background: var(--bg-raised, #f4f5f7);
}

.principle-entry__num {
  grid-row: 1 / -1;
  font-family: var(--font-mono, "Monaspace Xenon", ui-monospace, monospace);
  font-size: 1.4rem;
  font-weight: 350;
  color: var(--accent, #0058aa);
  line-height: 1.15;
  font-feature-settings: var(--ff-tabular, "tnum" 1, "kern" 1);
  padding-top: 0.15rem;
}

.principle-entry__title {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--fg-heading, #0f1419);
  line-height: 1.35;
}

.principle-entry__desc {
  font-size: 0.92rem;
  color: var(--fg-secondary, #6a7278);
  line-height: 1.5;
  max-width: 65ch;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border, #cfd5db);
  padding: 1.25rem clamp(1rem, 4vw, 2rem);
  color: var(--fg-secondary, #6a7278);
  font-size: 0.9rem;
}
.site-footer__meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
}

/* Source-of-truth row. Sits between the AI-summary block and the meta
 * line, mirroring the meta line's centered-flex layout. Renders as
 * "[GH] Source: spec · cli · site · skill"; the icon is a quiet kicker,
 * not a primary call-out — sized smaller than the AI-summary icons and
 * tinted to fg-muted with the same hover lift as the meta links. */
.site-footer__source {
  margin: 0 0 0.45rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  justify-content: center;
  font-size: 0.85rem;
}
.site-footer__source-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  color: var(--fg-muted, #525960);
  margin-right: 0.15rem;
}
.site-footer__source-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.site-footer__source-label {
  color: var(--fg-muted, #525960);
  letter-spacing: 0.01em;
}
.site-footer__source a {
  color: inherit;
  transition: color 120ms ease;
}
.site-footer__source a:hover {
  color: var(--fg-body, #1a2026);
}

/* AI summary CTA — provider icons above the meta line. */
.ai-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
}
.ai-summary__heading {
  margin: 0;
  font-size: 0.85rem;
  color: var(--fg-secondary, #6a7278);
  letter-spacing: 0.01em;
}
.ai-summary__icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.ai-summary__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--fg-muted, #525960);
  border-radius: 50%;
  transition:
    color 120ms ease,
    transform 120ms ease;
}
/* iOS Safari paints a 0×0 glyph for inline <svg> with viewBox but no
 * intrinsic width/height (per SVG2 spec). Size the child explicitly. */
.ai-summary__link svg {
  width: 100%;
  height: 100%;
  display: block;
}
.ai-summary__link:hover {
  color: var(--fg-body, #1a2026);
  transform: scale(1.12);
}

/* ================================================================
 * Leaderboard — /scorecards
 * ================================================================ */

/* Widen main for the leaderboard table */
.leaderboard-table-wrap {
  max-width: none;
}
body:has(.leaderboard-hero) main {
  max-width: 92ch;
}

.leaderboard-hero {
  padding-top: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(1rem, 2vw, 1.5rem);
}

.leaderboard-hero h1 {
  font-size: clamp(1.75rem, 2.5vw + 1rem, 2.5rem);
  line-height: 1.15;
  margin: 0;
}

.leaderboard-hero__lede {
  color: var(--fg-secondary, #6a7278);
  margin: 0.75rem 0 0;
  max-width: 62ch;
}

.leaderboard-hero__lede a {
  color: var(--accent, #0058aa);
}

/* Tier filter buttons */
.leaderboard-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
}

/* Agent-optimized toggle — sits beside the tier filter pills */
.audience-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--fg-secondary, #6a7278);
  cursor: pointer;
  user-select: none;
}
.audience-filter__input {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--accent, #0058aa);
}
.audience-filter:hover {
  color: var(--fg-body, #1a2026);
}

.tier-filters {
  display: flex;
  gap: 0;
  border: 1px solid var(--border, #cfd5db);
  border-radius: 0.375rem;
  overflow: hidden;
  width: fit-content;
}

.tier-filter {
  background: transparent;
  color: var(--fg-secondary, #6a7278);
  border: 0;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    color 120ms ease;
  letter-spacing: 0.01em;
}

.tier-filter + .tier-filter {
  border-left: 1px solid var(--border, #cfd5db);
}

.tier-filter:hover {
  background: var(--bg-raised, #f4f5f7);
  color: var(--fg-body, #1a2026);
}
.tier-filter--active {
  background: var(--bg-code, #eef2f5);
  color: var(--fg-body, #1a2026);
  font-weight: 600;
}

/* Leaderboard table */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.45;
}

.leaderboard-table thead {
  border-bottom: 2px solid var(--border, #cfd5db);
}

.leaderboard-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted, #525960);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
}

.leaderboard-table th[data-sort-col] {
  cursor: pointer;
}
.leaderboard-table th[data-sort-col]:hover {
  color: var(--fg-body, #1a2026);
}

.leaderboard-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle, #e5e8eb);
  vertical-align: middle;
}

.leaderboard-table tbody tr {
  transition: background-color 80ms ease;
}
.leaderboard-table tbody tr:hover {
  background: var(--bg-raised, #f4f5f7);
}

/* Hide rows filtered out by tier */
.leaderboard-table tbody tr[hidden] {
  display: none;
}

/* Rank column */
.lb-rank {
  font-family: var(--font-mono, "Monaspace Xenon", ui-monospace, monospace);
  font-feature-settings: var(--ff-tabular, "tnum" 1, "kern" 1);
  color: var(--fg-muted, #525960);
  width: 2.5rem;
  text-align: right;
}

/* Tool name column */
.lb-tool a {
  color: var(--accent, #0058aa);
  text-decoration: none;
  font-weight: 500;
}
.lb-tool a:hover {
  text-decoration: underline;
}

/* Description — hide on narrow screens */
.lb-desc {
  color: var(--fg-secondary, #6a7278);
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Language column */
.lb-lang {
  color: var(--fg-muted, #525960);
  font-size: 0.85rem;
}

/* Score column */
.lb-score {
  font-family: var(--font-mono, "Monaspace Xenon", ui-monospace, monospace);
  font-feature-settings: var(--ff-tabular, "tnum" 1, "kern" 1);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.lb-score--none,
.lb-principles--none {
  color: var(--fg-muted, #525960);
}

/* Principles column */
.lb-principles {
  font-family: var(--font-mono, "Monaspace Xenon", ui-monospace, monospace);
  font-feature-settings: var(--ff-tabular, "tnum" 1, "kern" 1);
  text-align: right;
  white-space: nowrap;
}

/* Tier badge — shared between leaderboard and scorecard pages */
.tier-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  white-space: nowrap;
}

.tier-badge--workhorse {
  background: var(--accent-subtle, #e6eef6);
  color: var(--accent, #0058aa);
}
.tier-badge--agent {
  background: oklch(92.00% 0.05 200);
  color: oklch(40.00% 0.1 200);
}
.tier-badge--notable {
  background: oklch(93.00% 0.04 70);
  color: oklch(45.00% 0.1 70);
}

/* Badge callout — surface #2 of the badge plan. Sits between the
   leaderboard table and the methodology section so a reader who has
   just scanned the rankings sees the next step (claim the badge) before
   the longer-form methodology prose.

   Surface uses the canonical `--bg-raised` token (defined for both
   light and dark in src/styles/foundation.css) — the same token the
   methodology / scorecard-summary surfaces use. Earlier draft used a
   fake `--bg-subtle` name that fell back to the light-mode hex literal
   in dark mode, producing near-white text on near-white background. */
.leaderboard-badge-callout {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border, #cfd5db);
  border-radius: 8px;
  background: var(--bg-raised, #f4f5f7);
}

.leaderboard-badge-callout h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
}

.leaderboard-badge-callout p {
  margin: 0;
  color: var(--fg-secondary, #6a7278);
}

/* Methodology section */
.leaderboard-methodology {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle, #e5e8eb);
}

.leaderboard-methodology h2 {
  margin-top: 0;
}
.leaderboard-methodology pre {
  font-size: 0.88rem;
}

/* Responsive: collapse description and language on small screens */
@media (max-width: 720px) {
  body:has(.leaderboard-hero) main {
    max-width: 100%;
    padding-inline: 1rem;
  }
  .lb-desc,
  .lb-lang {
    display: none;
  }
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.45rem 0.5rem;
  }
  .tier-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
  }
}

/* ================================================================
 * Scorecard — /score/<tool>
 * ================================================================ */

.scorecard-breadcrumb {
  padding: 0.5rem 0 0;
  font-size: 0.88rem;
}

.scorecard-breadcrumb a {
  color: var(--fg-muted, #525960);
  text-decoration: none;
}
.scorecard-breadcrumb a:hover {
  color: var(--accent, #0058aa);
  text-decoration: underline;
}

.scorecard-header {
  padding-bottom: 1.5rem;
}

.scorecard-header h1 {
  font-family: var(--font-mono, "Monaspace Xenon", ui-monospace, monospace);
  font-size: clamp(1.75rem, 2.5vw + 1rem, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0.25rem 0 0.5rem;
  line-height: 1.15;
}

.scorecard-header__desc {
  color: var(--fg-secondary, #6a7278);
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.scorecard-header__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--fg-muted, #525960);
  font-size: 0.88rem;
}

.scorecard-header__meta a {
  color: var(--accent, #0058aa);
  text-decoration: none;
}
.scorecard-header__meta a:hover {
  text-decoration: underline;
}

/* Audience banner — informational signal above the score summary */
.scorecard-audience-banner {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border-subtle, #e5e8eb);
  border-left: 3px solid var(--accent, #0058aa);
  border-radius: 0.375rem;
  background: var(--bg-raised, #f4f5f7);
}
.scorecard-audience-banner p {
  margin: 0.4rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.scorecard-audience-banner p:first-child {
  margin-top: 0;
}
.scorecard-audience-banner p:last-child {
  margin-bottom: 0;
}
.scorecard-audience-banner .audience-banner__headline {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted, #525960);
}
.audience-banner__headline strong {
  font-family: var(--font-mono, "Monaspace Xenon", ui-monospace, monospace);
  font-weight: 600;
  color: var(--fg-body, #1a2026);
}
.audience-banner__copy,
.audience-banner__profile {
  color: var(--fg-body, #1a2026);
}
.scorecard-audience-banner .audience-banner__note {
  font-size: 0.85rem;
  color: var(--fg-muted, #525960);
}
.audience-banner__note a {
  color: var(--accent, #0058aa);
}

.audit-profile-pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  margin-right: 0.35rem;
  border-radius: 0.2rem;
  background: var(--bg-code, #eef2f5);
  color: var(--fg-body, #1a2026);
  font-family: var(--font-mono, "Monaspace Xenon", ui-monospace, monospace);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Score + principle summary badges */
.scorecard-summary {
  display: flex;
  gap: 1.5rem;
  padding: 1.25rem 0 1.75rem;
  border-top: 1px solid var(--border-subtle, #e5e8eb);
  border-bottom: 1px solid var(--border-subtle, #e5e8eb);
}

.scorecard-score-badge,
.scorecard-principle-badge {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.scorecard-score-badge__pct,
.scorecard-principle-badge__count {
  font-family: var(--font-mono, "Monaspace Xenon", ui-monospace, monospace);
  font-feature-settings: var(--ff-tabular, "tnum" 1, "kern" 1);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  color: var(--fg-heading, #0f1419);
}

.scorecard-score-badge__label,
.scorecard-principle-badge__label {
  font-size: 0.8rem;
  color: var(--fg-muted, #525960);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Top issues */
.scorecard-issues {
  padding: 1.5rem 0;
}
.scorecard-issues h2 {
  margin-top: 0;
}

.scorecard-issues--clean p {
  color: var(--may, #007980);
  font-weight: 500;
}

.issue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.issue {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.issue__status {
  font-family: var(--font-mono, "Monaspace Xenon", ui-monospace, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 0.2rem;
  letter-spacing: 0.03em;
}

.issue--fail .issue__status {
  background: oklch(92.00% 0.04 28);
  color: var(--must, #af2b25);
}
.issue--warn .issue__status {
  background: oklch(93.00% 0.04 70);
  color: var(--should, #a16100);
}

.issue__label {
  font-weight: 500;
  color: var(--fg-body, #1a2026);
}

.issue__group {
  font-size: 0.85rem;
}
.issue__group a {
  color: var(--accent, #0058aa);
  text-decoration: none;
}
.issue__group a:hover {
  text-decoration: underline;
}

.issue__evidence {
  font-size: 0.82rem;
  color: var(--fg-muted, #525960);
  flex-basis: 100%;
  padding-left: 0;
}

/* All audits section */
.scorecard-audits {
  padding: 0.5rem 0;
}
.scorecard-audits h2 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.audit-group {
  margin-bottom: 1.5rem;
}

.audit-group__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.audit-group__title a {
  color: var(--accent, #0058aa);
  text-decoration: none;
}
.audit-group__title a:hover {
  text-decoration: underline;
}

.audit-group--bonus {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle, #e5e8eb);
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.audit-table td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--border-subtle, #e5e8eb);
  vertical-align: top;
}

.audit__status {
  font-family: var(--font-mono, "Monaspace Xenon", ui-monospace, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  width: 3.5rem;
  white-space: nowrap;
}

.audit--pass .audit__status {
  color: var(--may, #007980);
}
.audit--warn .audit__status {
  color: var(--should, #a16100);
}
.audit--fail .audit__status {
  color: var(--must, #af2b25);
}
.audit--skip .audit__status {
  color: var(--fg-muted, #525960);
}
.audit--error .audit__status {
  color: var(--must, #af2b25);
}
/* opt_out: deliberate non-adoption — counts against the score, so it reads in
   the caution family (--should), distinguished from warn by its OPT-OUT label. */
.check--opt_out .check__status {
  color: var(--should, #a16100);
}
/* n_a: conditional antecedent unmet — excluded from the score entirely, so it
   reads in the muted not-applicable family with skip, set apart by the italic
   label, the same way suppressed Skips are de-emphasized. */
.check--n_a .check__status {
  color: var(--fg-muted, #525960);
  font-style: italic;
}

/* Suppressed-by-audit-profile checks: distinct from organic Skips. The row is
   muted to signal "intentionally excluded by category" rather than "didn't run". */
.audit--suppressed {
  opacity: 0.65;
}
.audit--suppressed .audit__status {
  color: var(--fg-muted, #525960);
  font-size: 0.7rem;
  white-space: nowrap;
  width: auto;
  padding-right: 0.75rem;
}
.audit__label {
  color: var(--fg-body, #1a2026);
}
.audit--suppressed .audit__label {
  font-style: italic;
  color: var(--fg-muted, #525960);
}

.audit__evidence {
  color: var(--fg-muted, #525960);
  font-size: 0.82rem;
}

/* Metadata section */
.scorecard-meta {
  padding: 1rem 0;
  border-top: 1px solid var(--border-subtle, #e5e8eb);
}
.scorecard-meta h2 {
  margin-top: 0;
}

.meta-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  font-size: 0.9rem;
  margin: 0;
}

.meta-list dt {
  color: var(--fg-muted, #525960);
}
.meta-list dd {
  margin: 0;
  color: var(--fg-body, #1a2026);
}
/* Inline `<code>` inside the meta-list value column: keep monospace + size
 * but drop the global pill chrome (background, padding, radius, shrink-size).
 * The grid puts the value at the column edge; the pill's left padding pushes
 * the text right while leaving the background flush, so labels above
 * ("1.8.1", "2026-04-23") and the install command misalign. */
.meta-list dd code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Embed-snippet section — surface #1 of the badge plan. Sits between
   the detail sections and the reproduce-locally CTA. Eligible variant
   shows a copy-paste snippet + live SVG preview; below-floor variant
   shows a brief hint pointing at /badge and the top-issues section. */
.scorecard-embed {
  padding: 1.25rem 0;
  border-top: 1px solid var(--border-subtle, #e5e8eb);
}

.scorecard-embed h2 {
  margin-top: 0;
}

.scorecard-embed p {
  color: var(--fg-secondary, #6a7278);
}

.scorecard-embed pre {
  font-size: 0.88rem;
}

.scorecard-embed__preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.scorecard-embed__preview img {
  height: 20px;
  width: auto;
  vertical-align: middle;
}

/* CTA section */
.scorecard-cta {
  padding: 1.25rem 0;
  border-top: 1px solid var(--border-subtle, #e5e8eb);
}

.scorecard-cta p {
  color: var(--fg-secondary, #6a7278);
}
.scorecard-cta pre {
  font-size: 0.88rem;
}

/* Dark mode adjustments for scorecard-specific colors */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tier-badge--agent {
    background: oklch(22.00% 0.05 200);
    color: oklch(78.00% 0.1 200);
  }
  :root:not([data-theme="light"]) .tier-badge--notable {
    background: oklch(23.00% 0.04 70);
    color: oklch(80.00% 0.08 70);
  }
  :root:not([data-theme="light"]) .issue--fail .issue__status {
    background: oklch(22.00% 0.04 28);
    color: var(--must);
  }
  :root:not([data-theme="light"]) .issue--warn .issue__status {
    background: oklch(23.00% 0.04 70);
    color: var(--should);
  }
}
:root[data-theme="dark"] .tier-badge--agent {
  background: oklch(22.00% 0.05 200);
  color: oklch(78.00% 0.1 200);
}
:root[data-theme="dark"] .tier-badge--notable {
  background: oklch(23.00% 0.04 70);
  color: oklch(80.00% 0.08 70);
}
:root[data-theme="dark"] .issue--fail .issue__status {
  background: oklch(22.00% 0.04 28);
  color: var(--must);
}
:root[data-theme="dark"] .issue--warn .issue__status {
  background: oklch(23.00% 0.04 70);
  color: var(--should);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    transition-duration: 0.01ms;
  }
}

/* =============================================================
 * Live-scoring form — homepage paste-input surface.
 *
 * Integrates with the principle-entry rhythm above the principles
 * list: same `3rem 1fr` grid (kicker | content), same top-border
 * separator, same numbered-prefix-in-accent-mono treatment. The
 * kicker reads "Try" — telling the visitor this row is a
 * pre-principles entry point, not principle 0.
 *
 * Restraint over decoration: no card grid, no bordered widget,
 * no uppercase-tracked labels. The input IS the centerpiece — the
 * Score button carries the only solid color in the form so the
 * eye lands there without ambient ornament.
 *
 * Tokens: --accent for focus + submit + kicker, --bg-code for the
 * input field, --border for the hairline separator, --must for
 * error and bounce-panel keyword color. No side-stripe borders,
 * no glassmorphism, no gradient text.
 * ============================================================= */

.live-score {
  border-top: 1px solid var(--border-subtle, var(--border));
  /* Match the principle-entry enter-stagger so the form lands as the
   * first row of the homepage's content rhythm, not as a separate
   * widget below the hero. */
  animation: principle-enter 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 80ms;
}

.live-score__row {
  display: grid;
  grid-template-columns: 3rem 1fr;
  grid-template-rows: auto;
  column-gap: 1.25rem;
  padding: 1.5rem 0.75rem 1.75rem;
  margin: 0 -0.75rem;
}

.live-score__kicker {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 350;
  color: var(--accent);
  line-height: 1.15;
  padding-top: 0.15rem;
  font-feature-settings: var(--ff-tabular, "tnum" 1, "kern" 1);
  /* "Try" sits where the principle numbers sit — same column, same
   * font, same weight, same color. Visual continuity with the list
   * below; no decoration needed. */
}

.live-score__content {
  display: grid;
  /* Generous gap between heading + lede; tighter cluster lower down
   * (form input + chips). The varied rhythm is intentional. */
  gap: 0.35rem;
}

.live-score__title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--fg-heading);
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.live-score__lede {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--fg-secondary);
  line-height: 1.5;
  max-inline-size: 65ch;
}

.live-score__lede code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-code);
  padding: 0 0.3em;
  border-radius: 3px;
}

.live-score__form {
  display: grid;
  gap: 0.6rem;
}

.live-score__input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: stretch;
}

.live-score__input {
  font-family: var(--font-mono);
  /* Fluid larger size so the input reads as the centerpiece — bigger
   * than body type, smaller than h1. Matches the visual weight of
   * the principle title that follows it. */
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.4;
  padding: 0.7rem 0.85rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-body);
  min-inline-size: 0;
}

.live-score__input::placeholder {
  color: var(--fg-muted);
}

.live-score__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.live-score__input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.live-score__submit {
  font-family: var(--font-sans);
  /* Match the input's fluid size step so they read as a pair, not a
   * size jump. */
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  font-weight: 600;
  padding: 0.7rem 1.25rem;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
  /* The only solid-color surface in the form. Restrained color
   * strategy + one accent ≤10% works here because the form occupies
   * less than 10% of the homepage real estate. */
}

.live-score__submit:hover:not(:disabled) {
  filter: brightness(1.08);
}

.live-score__submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.live-score__submit:disabled {
  opacity: 0.7;
  cursor: progress;
}

/* Chips render as inline prose: "or try <code>ripgrep</code>, <code>...</code>".
 * Buttons under the hood (keyboard + ARIA), but visually they look
 * like clickable code spans, not action buttons. Differentiates from
 * the submit button so the eye lands on Score, not the chips. */
.live-score__help {
  margin: 0.1rem 0 0;
  font-size: 0.88rem;
  color: var(--fg-secondary);
  line-height: 1.6;
}

.live-score__chip {
  display: inline;
  font: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: color-mix(in oklch, var(--accent) 35%, transparent);
  text-underline-offset: 0.18em;
  /* Chips are atomic typographical units; browser may wrap BETWEEN chips
     at viewport-dependent points, but never inside a single chip's text. */
  white-space: nowrap;
}

.live-score__chip code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

.live-score__chip:hover {
  text-decoration-style: solid;
  text-decoration-color: var(--accent);
}

.live-score__chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Single-line status — JS swaps in prose like "Resolving install
 * path..." during a live run. Replaces the 4-tile progress grid
 * (slop: identical card grid). No fake animation; the 2 s theater
 * floor itself is the wait signal. */
.live-score__status {
  margin: 0.6rem 0 0;
  font-size: 0.92rem;
  color: var(--fg-body);
  /* Inherits monospace from code descendants when JS injects bounce
   * panels; for plain status text the sans body font is fine. */
}

.live-score__status--error {
  color: var(--must);
}

/* Curated-hit reward: the user pasted a tool we've already audited.
 * Identity-color the status text via --accent so the moment lands as
 * "you found one of ours" without a banner, badge, or animation. The
 * reward is visible for the remainder of the 2 s theater floor before
 * the redirect to /score/<slug>; mid-dot separators in the copy mirror
 * the footer rhythm. */
.live-score__status--curated {
  color: var(--accent);
  font-weight: 600;
  font-feature-settings: var(--ff-tabular, "tnum" 1, "kern" 1);
}

.live-score__status--bounce .live-score__bounce-headline {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--must);
}

.live-score__status--bounce .live-score__bounce-body {
  margin: 0 0 0.6rem;
  color: var(--fg-body);
  font-size: 0.92rem;
  line-height: 1.5;
}

.live-score__status--bounce .live-score__bounce-body code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-code);
  padding: 0 0.3em;
  border-radius: 3px;
}

.live-score__status--bounce .live-score__bounce-stderr {
  margin: 0 0 0.6rem;
  max-block-size: 16rem;
  overflow: auto;
  font-size: 0.82rem;
  padding: 0.6rem 0.8rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* Narrow viewports: collapse the principle-rhythm grid so the kicker
 * sits inline with the content. Avoids the awkward 3rem orphan column
 * on phones. (max-width vs max-inline-size: the latter is CSS MQ L5 and
 * not yet broadly supported / not yet in biome's recognized spec list.
 * max-width is functionally equivalent for this LTR site.) */
@media (max-width: 36rem) {
  .live-score__row {
    grid-template-columns: 1fr;
    row-gap: 0.4rem;
    padding: 1.25rem 0.75rem 1.5rem;
  }
  .live-score__kicker {
    font-size: 1rem;
    line-height: 1.4;
    padding-top: 0;
  }
  .live-score__input-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .live-score__submit {
    /* Full-width on narrow viewports — the input and button stack and
     * each spans the full content column. */
    justify-self: stretch;
  }
}

/* =============================================================
 * /score/live/<binary> result page — share surface.
 * Reuses the per-tool scorecard score badge component; adds a
 * compact header with version + binary + freshness marker.
 * ============================================================= */

.live-score-summary__header {
  margin-block-end: var(--space-5);
}

.live-score-summary__header h1 {
  margin: 0;
  font-size: var(--text-h1);
  letter-spacing: -0.01em;
}

.live-score-summary__version {
  font-family: var(--font-mono);
  font-size: 0.72em;
  font-weight: 400;
  color: var(--fg-secondary);
  margin-inline-start: var(--space-3);
}

.live-score-summary__meta {
  margin-block: var(--space-3) 0;
  color: var(--fg-secondary);
  font-size: var(--text-secondary);
}

.live-score-summary__meta code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-code);
  padding: 0 0.35em;
  border-radius: 3px;
}

.live-score-summary__freshness {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  margin-inline-start: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: lowercase;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--fg-muted);
}

.live-score-summary__freshness--live {
  color: var(--may);
  border-color: var(--may);
}

.live-score-summary__score {
  margin-block: var(--space-5);
}

.live-score-summary__issues {
  margin-block: var(--space-5);
}

.live-score-summary__issues h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-h3);
}

.live-score-summary__cta {
  margin-block: var(--space-6) var(--space-5);
  padding-block-start: var(--space-5);
  border-top: 1px solid var(--border);
}

.live-score-summary__cta h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-h3);
}

.live-score-summary__cta p {
  color: var(--fg-secondary);
  max-inline-size: var(--measure);
}

.live-score-summary__cta-aside {
  font-size: var(--text-secondary);
}
