/*
 * Autonomous Engineering Skills
 * Shared GitHub Pages visual system
 *
 * Industrial, measured, and deliberately low-gloss. The 32px engineering
 * grid, ruled surfaces, mono instrumentation, and rust accent are the brand.
 */

/* --- Design tokens ------------------------------------------------------- */
:root {
  color-scheme: light;
  --ground: #f6f3ee;
  --ground: oklch(0.975 0.006 75);
  --ground-2: #eae6df;
  --ground-2: oklch(0.945 0.008 75);
  --ground-3: #dfdbd4;
  --ground-3: oklch(0.91 0.01 75);
  --ink: #2b2d33;
  --ink: oklch(0.24 0.012 265);
  --ink-2: #6c6f78;
  --ink-2: oklch(0.48 0.012 265);
  --rule: rgba(43, 45, 51, 0.14);
  --rule: oklch(0.24 0.012 265 / 0.14);
  --rule-2: rgba(43, 45, 51, 0.07);
  --rule-2: oklch(0.24 0.012 265 / 0.07);
  --rule-strong: rgba(43, 45, 51, 0.3);
  --rule-strong: oklch(0.24 0.012 265 / 0.3);
  --accent: #c26a34;
  --accent: oklch(0.56 0.17 42);
  --accent-wash: rgba(194, 106, 52, 0.08);
  --accent-wash: oklch(0.56 0.17 42 / 0.08);
  --verified: #3f8f5c;
  --verified: oklch(0.55 0.12 155);
  --verified-wash: rgba(63, 143, 92, 0.09);
  --verified-wash: oklch(0.55 0.12 155 / 0.09);
  --blocked: #c23b28;
  --blocked: oklch(0.53 0.2 27);
  --blocked-wash: rgba(194, 59, 40, 0.08);
  --blocked-wash: oklch(0.53 0.2 27 / 0.08);
  --preview: #99711d;
  --preview: oklch(0.55 0.12 80);
  --preview-wash: rgba(153, 113, 29, 0.09);
  --preview-wash: oklch(0.55 0.12 80 / 0.09);
  --serif: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --maxw: 1180px;
  --contentw: 760px;
  --header-h: 60px;
  --r: 2px;
  --sp: 4px;
  --shadow-float: 0 18px 55px rgba(43, 45, 51, 0.09);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --ground: #15171d;
    --ground: oklch(0.19 0.012 260);
    --ground-2: #1c1f27;
    --ground-2: oklch(0.23 0.014 260);
    --ground-3: #242832;
    --ground-3: oklch(0.27 0.016 260);
    --ink: #e9e6df;
    --ink: oklch(0.93 0.006 75);
    --ink-2: #a7a49c;
    --ink-2: oklch(0.7 0.008 75);
    --rule: rgba(233, 230, 223, 0.16);
    --rule: oklch(0.93 0.01 75 / 0.16);
    --rule-2: rgba(233, 230, 223, 0.08);
    --rule-2: oklch(0.93 0.01 75 / 0.08);
    --rule-strong: rgba(233, 230, 223, 0.32);
    --rule-strong: oklch(0.93 0.01 75 / 0.32);
    --accent: #e08a4f;
    --accent: oklch(0.68 0.16 45);
    --accent-wash: rgba(224, 138, 79, 0.1);
    --accent-wash: oklch(0.68 0.16 45 / 0.1);
    --verified: #63c088;
    --verified: oklch(0.72 0.14 158);
    --verified-wash: rgba(99, 192, 136, 0.1);
    --verified-wash: oklch(0.72 0.14 158 / 0.1);
    --blocked: #e26a55;
    --blocked: oklch(0.66 0.2 27);
    --blocked-wash: rgba(226, 106, 85, 0.1);
    --blocked-wash: oklch(0.66 0.2 27 / 0.1);
    --preview: #d7a94a;
    --preview: oklch(0.73 0.13 82);
    --preview-wash: rgba(215, 169, 74, 0.1);
    --preview-wash: oklch(0.73 0.13 82 / 0.1);
    --shadow-float: 0 22px 65px rgba(0, 0, 0, 0.25);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #15171d;
  --ground: oklch(0.19 0.012 260);
  --ground-2: #1c1f27;
  --ground-2: oklch(0.23 0.014 260);
  --ground-3: #242832;
  --ground-3: oklch(0.27 0.016 260);
  --ink: #e9e6df;
  --ink: oklch(0.93 0.006 75);
  --ink-2: #a7a49c;
  --ink-2: oklch(0.7 0.008 75);
  --rule: rgba(233, 230, 223, 0.16);
  --rule: oklch(0.93 0.01 75 / 0.16);
  --rule-2: rgba(233, 230, 223, 0.08);
  --rule-2: oklch(0.93 0.01 75 / 0.08);
  --rule-strong: rgba(233, 230, 223, 0.32);
  --rule-strong: oklch(0.93 0.01 75 / 0.32);
  --accent: #e08a4f;
  --accent: oklch(0.68 0.16 45);
  --accent-wash: rgba(224, 138, 79, 0.1);
  --accent-wash: oklch(0.68 0.16 45 / 0.1);
  --verified: #63c088;
  --verified: oklch(0.72 0.14 158);
  --verified-wash: rgba(99, 192, 136, 0.1);
  --verified-wash: oklch(0.72 0.14 158 / 0.1);
  --blocked: #e26a55;
  --blocked: oklch(0.66 0.2 27);
  --blocked-wash: rgba(226, 106, 85, 0.1);
  --blocked-wash: oklch(0.66 0.2 27 / 0.1);
  --preview: #d7a94a;
  --preview: oklch(0.73 0.13 82);
  --preview-wash: rgba(215, 169, 74, 0.1);
  --preview-wash: oklch(0.73 0.13 82 / 0.1);
  --shadow-float: 0 22px 65px rgba(0, 0, 0, 0.25);
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* --- Reset and global type ----------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--ground);
  background-image:
    linear-gradient(var(--rule-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-2) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  display: block;
  min-height: calc(100vh - 180px);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
[role="button"] {
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

code,
kbd,
samp,
pre {
  font-family: var(--mono);
}

code {
  overflow-wrap: anywhere;
}

::selection {
  background: var(--accent);
  color: var(--ground);
}

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

[id] {
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.wrap,
.shell,
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

.narrow,
.prose-wrap {
  width: 100%;
  max-width: var(--contentw);
}

.rule-top {
  border-top: 1px solid var(--rule);
}

.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip,
.skip-link {
  position: absolute;
  left: -9999px;
}

.skip:focus,
.skip-link:focus {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--ground);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
}

/* --- Labels, links, buttons ---------------------------------------------- */
.lab,
.eyebrow,
.kicker {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  line-height: 1.45;
  text-transform: uppercase;
}

.lab .mk,
.eyebrow::before,
.kicker .mk {
  color: var(--accent);
}

.eyebrow::before {
  content: "\25B8";
  margin-right: 0.6em;
}

.text-link,
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.text-link::after,
.arrow-link::after {
  content: "\2192";
  transition: transform 0.16s var(--ease);
}

/* Generated link labels already include their directional glyph. */
.text-link::after { display: none; }

.text-link:hover::after,
.arrow-link:hover::after {
  transform: translateX(3px);
}

.btn,
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: var(--ink);
  color: var(--ground);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none;
  transition:
    transform 0.15s var(--ease),
    background-color 0.15s var(--ease),
    border-color 0.15s var(--ease);
}

.btn:hover,
.button:hover {
  transform: translateY(-2px);
}

.btn.ghost,
.btn.secondary,
.button.secondary {
  border-color: var(--rule-strong);
  background: transparent;
  color: var(--ink);
}

.btn.ghost:hover,
.btn.secondary:hover,
.button.secondary:hover {
  border-color: var(--ink);
}

.btn.compact,
.button.compact {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 12px;
}

.cta,
.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* --- Header and mobile navigation ---------------------------------------- */
header.bar,
.site-header {
  position: sticky;
  z-index: 40;
  top: 0;
  border-bottom: 1px solid var(--rule);
  background: rgba(246, 243, 238, 0.92);
  background: color-mix(in oklab, var(--ground) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.bar .wrap,
.site-header .header-inner,
.site-header > .wrap {
  position: relative;
  display: flex;
  min-height: var(--header-h);
  align-items: center;
  gap: 20px;
}

.brand,
.site-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.brand .logo,
.site-brand .logo,
.site-brand img {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 6px;
}

.bar nav,
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 22px);
  margin-left: auto;
}

.bar nav a,
.site-nav a {
  position: relative;
  padding-block: 8px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.bar nav a:hover,
.site-nav a:hover,
.site-nav a[aria-current="page"],
.site-nav a[aria-current="true"] {
  color: var(--ink);
}

.site-nav a[aria-current="page"]::after,
.site-nav a[aria-current="true"]::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
}

.themebtn,
.theme-toggle,
.nav-toggle {
  min-height: 34px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.themebtn,
.theme-toggle {
  padding: 6px 9px;
  white-space: nowrap;
}

.themebtn:hover,
.theme-toggle:hover,
.nav-toggle:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 40px;
  padding: 0;
}

.nav-toggle-lines,
.nav-toggle-lines::before,
.nav-toggle-lines::after {
  display: block;
  width: 16px;
  height: 1px;
  margin-inline: auto;
  background: currentColor;
  content: "";
  transition: transform 0.18s var(--ease);
}

.nav-toggle-lines::before {
  transform: translateY(-5px);
}

.nav-toggle-lines::after {
  transform: translateY(4px);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::before {
  transform: translateY(0) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::after {
  transform: translateY(-1px) rotate(-45deg);
}

/* --- Breadcrumbs --------------------------------------------------------- */
.breadcrumbs,
.breadcrumb {
  border-bottom: 1px solid var(--rule);
  background: rgba(246, 243, 238, 0.45);
  background: color-mix(in oklab, var(--ground) 60%, transparent);
}

.breadcrumbs ol,
.breadcrumb ol {
  display: flex;
  min-height: 42px;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding-block: 9px;
  list-style: none;
}

.breadcrumbs li,
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.breadcrumbs li + li::before,
.breadcrumb li + li::before {
  margin-right: 7px;
  color: var(--accent);
  content: "/";
}

.breadcrumbs a,
.breadcrumb a {
  text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumb a:hover {
  color: var(--ink);
}

/* --- Section framing ----------------------------------------------------- */
section,
.section {
  padding-block: clamp(52px, 8vw, 92px);
  border-top: 1px solid var(--rule);
}

main > section:nth-of-type(even),
main > .section:nth-of-type(even) {
  background: rgba(43, 45, 51, 0.025);
  background: color-mix(in oklab, var(--ink) 4%, transparent);
}

.shead,
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 38px;
}

.shead h2,
.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.06;
  text-wrap: balance;
}

.shead p:not(.lab),
.section-head p:not(.lab):not(.eyebrow) {
  max-width: 54ch;
  color: var(--ink-2);
  font-size: 16px;
}

.section-intro {
  max-width: 62ch;
  margin-bottom: 32px;
  color: var(--ink-2);
  font-size: clamp(17px, 2vw, 20px);
}

/* --- Home and page heroes ------------------------------------------------ */
.hero,
.page-hero {
  position: relative;
  padding-block: clamp(44px, 7vw, 84px);
  border-top: 0;
}

.hgrid,
.page-hero-grid,
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 372px);
  align-items: center;
  gap: clamp(28px, 5vw, 68px);
}

.hero h1,
.page-hero h1,
.display-title {
  max-width: 16ch;
  font-family: var(--serif);
  font-size: clamp(38px, 6.4vw, 74px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.01;
  text-wrap: balance;
}

.page-hero.compact h1,
.page-hero .compact-title,
.page-title {
  max-width: 20ch;
  font-size: clamp(36px, 5vw, 62px);
}

.hero h1 .hl,
.page-hero h1 .hl,
.accent {
  color: var(--accent);
}

.hero .sub,
.page-hero .lede,
.hero-lede,
.lede {
  max-width: 42ch;
  margin-top: 22px;
  color: var(--ink-2);
  font-size: clamp(17px, 2vw, 20px);
}

.hero .cta,
.page-hero .hero-actions,
.page-hero .cta {
  margin-top: 30px;
}

.hero-meta,
.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 26px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.hero-meta > *,
.meta-strip > * {
  min-width: 128px;
  flex: 1 1 128px;
  padding: 10px 13px;
  border-right: 1px solid var(--rule);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
}

.hero-meta > *:last-child,
.meta-strip > *:last-child {
  border-right: 0;
}

.hero-meta strong,
.meta-strip strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.hero-index {
  position: absolute;
  z-index: -1;
  top: 10px;
  right: clamp(20px, 5vw, 40px);
  color: var(--rule-2);
  font-family: var(--mono);
  font-size: clamp(90px, 18vw, 220px);
  font-weight: 600;
  letter-spacing: -0.08em;
  line-height: 1;
  user-select: none;
}

/* --- Ruled panels and terminal ------------------------------------------- */
.panel,
.instrument-panel,
.corner-panel {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--ground-2);
}

.panel::before,
.panel::after,
.instrument-panel::before,
.instrument-panel::after,
.corner-panel::before,
.corner-panel::after {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--accent);
  content: "";
  pointer-events: none;
}

.panel::before,
.instrument-panel::before,
.corner-panel::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.panel::after,
.instrument-panel::after,
.corner-panel::after {
  right: -1px;
  bottom: -1px;
  border-top: 0;
  border-left: 0;
}

.panel-head,
.panel-title,
.term .top,
.looptop {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-body {
  padding: clamp(18px, 3vw, 28px);
}

.term,
.terminal {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
}

.term .top .dot,
.terminal .dot {
  width: 8px;
  height: 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
}

.term .body,
.terminal-body {
  min-height: 250px;
  padding: 16px 16px 18px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.term .ln,
.terminal .ln {
  display: block;
}

.term .cmd,
.terminal .cmd {
  color: var(--ink);
}

.term .cmd .p,
.terminal .prompt,
.term .tag,
.terminal .tag {
  color: var(--accent);
}

.term .mut,
.terminal .muted {
  color: var(--ink-2);
}

.term .ok,
.terminal .ok {
  color: var(--verified);
}

.term .bad,
.terminal .bad {
  color: var(--blocked);
}

.term.type .ln,
.terminal.type .ln {
  opacity: 0;
}

.term.type.run .ln,
.terminal.type.run .ln {
  transition: opacity 0.28s;
}

.caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
  background: var(--accent);
  vertical-align: -2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* --- Pipeline visual retained from the landing page ---------------------- */
.loopwrap { padding: 0; }
.looptop { flex-wrap: wrap; }
.loopsvg { width: 100%; height: auto; padding: 14px 12px; }
.loopsvg .box { fill: var(--ground); stroke: var(--rule); stroke-width: 1.4; }
.loopsvg .loopcard { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 1.4; }
.loopsvg .num { fill: var(--accent); font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; }
.loopsvg .cmd { fill: var(--ink); font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.loopsvg .role { fill: var(--ink-2); font-family: var(--mono); font-size: 9px; letter-spacing: 0.02em; }
.loopsvg .lc { fill: var(--accent); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.loopsvg .lr { fill: var(--ink-2); font-family: var(--mono); font-size: 9px; }
.loopsvg .chev path { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.loopsvg .chev.acc path { stroke: var(--accent); }
.loopsvg .fb { fill: none; stroke: var(--accent); stroke-width: 2; }
.loopsvg .ahfb { fill: var(--accent); }
.loopsvg .fbt { fill: var(--accent); font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; }

/* --- Status badges and stamps -------------------------------------------- */
.status,
.status-badge,
.badge,
.stamp {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.status::before,
.status-badge::before,
.badge::before {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status.shipped,
.status.available,
.status.verified,
.status-badge.shipped,
.status-badge.available,
.status-badge.verified,
.badge.success {
  border-color: var(--verified);
  background: var(--verified-wash);
  color: var(--verified);
}

.status.preview,
.status.planned,
.status-badge.preview,
.status-badge.planned,
.badge.warning {
  border-color: var(--preview);
  background: var(--preview-wash);
  color: var(--preview);
}

.status.blocked,
.status.unavailable,
.status-badge.blocked,
.status-badge.unavailable,
.badge.danger {
  border-color: var(--blocked);
  background: var(--blocked-wash);
  color: var(--blocked);
}

.stamp {
  border-width: 1.5px;
  border-color: var(--blocked);
  color: var(--blocked);
  font-size: 12px;
  transform: rotate(-1.5deg);
  text-transform: none;
}

/* --- Failure and contract grids ------------------------------------------ */
.fails,
.contract,
.ruled-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.contract3,
.ruled-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fail,
.ct,
.ruled-cell {
  min-width: 0;
  padding: 21px 23px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.fail {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.fail .x {
  flex: none;
  margin-top: 2px;
  color: var(--blocked);
  font-family: var(--mono);
  font-weight: 600;
}

.fail b { font-weight: 600; }
.fail p { margin-top: 3px; color: var(--ink-2); font-size: 14.5px; }

.ct h3,
.ruled-cell h3 {
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.ct p,
.ruled-cell p {
  color: var(--ink-2);
  font-size: 15px;
}

.fails > :nth-child(2n),
.contract:not(.contract3) > :nth-child(2n),
.ruled-grid.cols-2 > :nth-child(2n) {
  border-right: 0;
}

.contract3 > :nth-child(3n),
.ruled-grid.cols-3 > :nth-child(3n) {
  border-right: 0;
}

.fails > :nth-last-child(-n + 2),
.contract:not(.contract3) > :nth-last-child(-n + 2),
.ruled-grid.cols-2 > :nth-last-child(-n + 2),
.contract3 > :nth-last-child(-n + 3),
.ruled-grid.cols-3 > :nth-last-child(-n + 3) {
  border-bottom: 0;
}

/* --- Instrument strips and workflow rails ------------------------------- */
.strip-scroll,
.workflow-scroll {
  margin-inline: calc(-1 * clamp(20px, 5vw, 40px));
  padding-inline: clamp(20px, 5vw, 40px);
  padding-bottom: 7px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.strip,
.workflow-rail {
  display: grid;
  min-width: 760px;
  grid-auto-columns: minmax(120px, 1fr);
  grid-auto-flow: column;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: color-mix(in oklab, var(--ground) 80%, transparent);
}

.stage,
.workflow-step {
  position: relative;
  min-width: 0;
  padding: 16px 14px 18px;
  border-right: 1px solid var(--rule);
}

.stage:last-child,
.workflow-step:last-child {
  border-right: 0;
}

.stage .n,
.workflow-step .step-no,
.workflow-step::before {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.workflow-step[data-step]::before {
  content: attr(data-step);
}

.stage .cmd,
.workflow-step h3,
.workflow-step .step-title {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.stage .d,
.workflow-step p {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.45;
}

.workflow-rail.vertical {
  min-width: 0;
  grid-auto-flow: row;
  grid-template-columns: 1fr;
}

.workflow-rail.vertical .workflow-step {
  display: grid;
  grid-template-columns: 52px minmax(130px, 0.45fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 14px;
  border-right: 0;
  border-bottom: 1px solid var(--rule);
}

.workflow-rail.vertical .workflow-step:last-child {
  border-bottom: 0;
}

.workflow-rail.vertical .workflow-step h3,
.workflow-rail.vertical .workflow-step p {
  margin-top: 0;
}

.loopnote {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12.5px;
}

.loopnote b { color: var(--accent); font-weight: 600; }

/* --- Tables and comparison ----------------------------------------------- */
.scrollx,
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.matrix,
.compare-table,
.data-table {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-collapse: collapse;
  border-radius: var(--r);
  font-size: 15px;
}

.matrix caption,
.compare-table caption,
.data-table caption {
  padding-bottom: 12px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}

.matrix th,
.matrix td,
.compare-table th,
.compare-table td,
.data-table th,
.data-table td {
  padding: 15px 17px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.matrix th:last-child,
.matrix td:last-child,
.compare-table th:last-child,
.compare-table td:last-child,
.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

.matrix tbody tr:last-child td,
.compare-table tbody tr:last-child td,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.matrix thead th,
.compare-table thead th,
.data-table thead th {
  background: var(--ground-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.matrix code,
.compare-table code,
.data-table code {
  color: var(--accent);
  font-size: 13px;
}

.matrix .mono,
.compare-table .mono,
.data-table .mono {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12.5px;
}

.cell-check { color: var(--verified); font-family: var(--mono); font-weight: 600; }
.cell-dash { color: var(--ink-2); font-family: var(--mono); }
.cell-warn { color: var(--preview); font-family: var(--mono); font-weight: 600; }

/* --- Skills catalog ------------------------------------------------------ */
.catalog-group,
.cat {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.catalog-group:last-child,
.cat:last-child { margin-bottom: 0; }

.catalog-head,
.cat-h {
  display: flex;
  grid-column: 1 / -1;
  align-items: baseline;
  gap: 13px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--ground-2);
}

.catalog-head h2,
.catalog-head h3,
.cat-h b {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.catalog-head p,
.catalog-head span,
.cat-h span {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.skill-card,
.row2 {
  position: relative;
  min-width: 0;
  padding: 19px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: color-mix(in oklab, var(--ground) 82%, transparent);
  transition:
    background-color 0.16s var(--ease),
    border-color 0.16s var(--ease),
    transform 0.16s var(--ease);
}

.cat .row2 {
  border: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
}

.cat > .row2:nth-child(odd) { border-right: 0; }

.skill-card::before,
.row2::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--accent);
  content: "";
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.18s var(--ease);
}

.skill-card:hover,
.skill-card:focus-within,
.row2:hover,
.row2:focus-within {
  border-color: var(--rule-strong);
  background: var(--accent-wash);
  transform: translateY(-2px);
}

.cat .row2:hover,
.cat .row2:focus-within { transform: none; }

.skill-card:hover::before,
.skill-card:focus-within::before,
.row2:hover::before,
.row2:focus-within::before { transform: scaleY(1); }

.skill-card h2,
.skill-card h3,
.skill-card .skill-name,
.row2 .nm {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.skill-card h2 a,
.skill-card h3 a,
.skill-card .skill-name a,
.row2 .nm { text-decoration: none; }

.skill-card h2 a::after,
.skill-card h3 a::after,
.skill-card .skill-name a::after {
  position: absolute;
  inset: 0;
  content: "";
}

.skill-card p,
.row2 p {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.52;
}

.skill-card-top,
.skill-card-footer,
.skill-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-card-top { justify-content: space-between; margin-bottom: 14px; }
.skill-card-footer { justify-content: space-between; margin-top: 18px; }
.skill-meta { color: var(--ink-2); font-family: var(--mono); font-size: 10.5px; }

.row2.empty,
.skill-card.empty {
  background: repeating-linear-gradient(-45deg, transparent, transparent 9px, var(--rule-2) 9px, var(--rule-2) 10px);
}

.row2.empty::before,
.skill-card.empty::before { display: none; }

.filters,
.catalog-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-chip {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--ground);
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
}

.filter-chip:hover,
.filter-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
}

/* --- Skill detail layouts ------------------------------------------------ */
.detail-grid,
.skill-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  align-items: start;
  gap: clamp(32px, 6vw, 72px);
}

.detail-main,
.skill-content { min-width: 0; }

.detail-aside,
.skill-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.fact-list,
.facts {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--ground-2);
}

.fact,
.facts > div {
  display: grid;
  grid-template-columns: minmax(88px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--rule);
}

.fact:last-child,
.facts > div:last-child { border-bottom: 0; }

.fact dt,
.facts dt {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fact dd,
.facts dd {
  min-width: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.aside-nav,
.toc {
  margin-top: 18px;
  padding-left: 14px;
  border-left: 1px solid var(--rule);
}

.aside-nav strong,
.toc strong {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.aside-nav ul,
.toc ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.aside-nav a,
.toc a {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  text-decoration: none;
}

.aside-nav a:hover,
.toc a:hover { color: var(--accent); }

.prose,
.doc-content,
.rich-text {
  color: var(--ink);
}

.prose > * + *,
.doc-content > * + *,
.rich-text > * + * { margin-top: 1.1em; }

.prose h2,
.doc-content h2,
.rich-text h2 {
  margin-top: clamp(42px, 6vw, 64px);
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: clamp(25px, 3.3vw, 36px);
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.prose h3,
.doc-content h3,
.rich-text h3 {
  margin-top: 32px;
  font-family: var(--serif);
  font-size: clamp(19px, 2.2vw, 24px);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.prose h4,
.doc-content h4,
.rich-text h4 {
  margin-top: 24px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prose p,
.doc-content p,
.rich-text p,
.prose li,
.doc-content li,
.rich-text li { max-width: 70ch; }

.prose ul,
.prose ol,
.doc-content ul,
.doc-content ol,
.rich-text ul,
.rich-text ol {
  display: grid;
  gap: 0.45em;
  padding-left: 1.3em;
}

.prose li::marker,
.doc-content li::marker,
.rich-text li::marker { color: var(--accent); font-family: var(--mono); }

.prose :not(pre) > code,
.doc-content :not(pre) > code,
.rich-text :not(pre) > code {
  padding: 0.08em 0.3em;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--ground-2);
  color: var(--accent);
  font-size: 0.82em;
}

.prose pre,
.doc-content pre,
.rich-text pre,
.code-block {
  max-width: 100%;
  padding: 17px 18px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--ground-2);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

.prose blockquote,
.doc-content blockquote,
.rich-text blockquote {
  padding: 15px 18px;
  border-left: 2px solid var(--accent);
  background: var(--accent-wash);
  color: var(--ink-2);
}

.io-grid,
.guarantee-grid,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.io-panel,
.guarantee,
.feature {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: color-mix(in oklab, var(--ground) 82%, transparent);
}

.io-panel h3,
.guarantee h3,
.feature h3 {
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  line-height: 1.4;
  text-transform: uppercase;
}

.io-panel p,
.guarantee p,
.feature p { color: var(--ink-2); font-size: 14px; }

.callout,
.notice {
  position: relative;
  padding: 17px 19px 17px 48px;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: var(--r);
  background: var(--accent-wash);
}

.callout::before,
.notice::before {
  position: absolute;
  top: 17px;
  left: 17px;
  color: var(--accent);
  content: "i";
  font-family: var(--mono);
  font-weight: 600;
}

.callout.warning,
.notice.warning { border-left-color: var(--preview); background: var(--preview-wash); }
.callout.warning::before,
.notice.warning::before { color: var(--preview); content: "!"; }
.callout.danger,
.notice.danger { border-left-color: var(--blocked); background: var(--blocked-wash); }
.callout.danger::before,
.notice.danger::before { color: var(--blocked); content: "\00D7"; }

/* --- Platform pages and plugin feature cards ----------------------------- */
.platform-grid,
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 28px);
}

.platform-card,
.plugin-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--ground-2);
}

.platform-card::before,
.plugin-card::before {
  height: 3px;
  background: var(--accent);
  content: "";
}

.platform-card-head,
.plugin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--rule);
}

.platform-card h2,
.platform-card h3,
.plugin-card h2,
.plugin-card h3 {
  font-family: var(--serif);
  font-size: clamp(23px, 3vw, 31px);
  line-height: 1.1;
}

.platform-card-body,
.plugin-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 22px 22px;
}

.platform-card-body > p,
.plugin-card-body > p { color: var(--ink-2); }

.platform-features,
.plugin-features {
  display: grid;
  gap: 0;
  margin: 20px 0 22px;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.platform-features li,
.plugin-features li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 14px;
}

.platform-features li::before,
.plugin-features li::before {
  position: absolute;
  left: 1px;
  color: var(--verified);
  content: "\2713";
  font-family: var(--mono);
}

.platform-card .actions,
.plugin-card .actions { margin-top: auto; }

.platform-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border: 1px solid var(--rule);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 16px;
}

/* --- Command rows -------------------------------------------------------- */
.cmdrow,
.command-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--ground-2);
}

.cmdrow code,
.command-row code {
  min-width: 0;
  flex: 1;
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  white-space: nowrap;
}

.cmdrow .cp,
.command-row .copy,
.copy-button {
  min-width: 72px;
  padding-inline: 15px;
  border: 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.cmdrow .cp:hover,
.command-row .copy:hover,
.copy-button:hover { color: var(--accent); }

.cmdrow .cp[data-copied="true"],
.command-row .copy[data-copied="true"],
.copy-button[data-copied="true"] { color: var(--verified); }

/* --- Related cards and previous/next ------------------------------------- */
.related-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.related-card,
.link-card {
  position: relative;
  min-width: 0;
  padding: 18px 19px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: color-mix(in oklab, var(--ground) 82%, transparent);
  text-decoration: none;
  transition:
    border-color 0.16s var(--ease),
    background-color 0.16s var(--ease),
    transform 0.16s var(--ease);
}

.related-card:hover,
.link-card:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
  transform: translateY(-2px);
}

.related-card .lab,
.link-card .lab { display: block; margin-bottom: 9px; }

.related-card h3,
.link-card h3 {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
}

.related-card p,
.link-card p { margin-top: 7px; color: var(--ink-2); font-size: 13px; }

.page-nav,
.prev-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.page-nav a,
.prev-next a {
  position: relative;
  min-width: 0;
  padding: 19px 20px;
  text-decoration: none;
}

.page-nav a + a,
.prev-next a + a {
  border-left: 1px solid var(--rule);
  text-align: right;
}

.page-nav a:hover,
.prev-next a:hover { background: var(--accent-wash); }

.page-nav small,
.prev-next small {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-nav strong,
.prev-next strong {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}

/* --- 404 ----------------------------------------------------------------- */
.not-found,
.error-page {
  display: grid;
  min-height: calc(100vh - var(--header-h) - 100px);
  place-items: center;
  padding-block: 60px;
}

.not-found-inner,
.error-page-inner {
  position: relative;
  width: min(100%, 820px);
  padding: clamp(30px, 7vw, 70px);
  border: 1px solid var(--rule);
  background: var(--ground-2);
  text-align: center;
}

.error-code {
  color: var(--accent);
  font-family: var(--mono);
  font-size: clamp(84px, 18vw, 180px);
  font-weight: 600;
  letter-spacing: -0.08em;
  line-height: 0.8;
}

.not-found h1,
.error-page h1 {
  margin-top: 26px;
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
}

.not-found p,
.error-page p {
  max-width: 50ch;
  margin: 16px auto 0;
  color: var(--ink-2);
}

.not-found .actions,
.error-page .actions {
  justify-content: center;
  margin-top: 28px;
}

/* --- Footer -------------------------------------------------------------- */
footer,
.site-footer {
  padding-block: 40px;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12.5px;
}

footer .wrap,
.site-footer .footer-inner,
.site-footer > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 24px;
}

footer nav,
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

footer a,
.site-footer a { color: var(--ink-2); text-decoration: none; }
footer a:hover,
.site-footer a:hover { color: var(--accent); }

/* --- Progressive reveal ------------------------------------------------- */
.reveal {
  transition:
    opacity 0.55s var(--ease),
    transform 0.55s var(--ease);
}

.reveal.pre {
  opacity: 0;
  transform: translateY(14px);
}

.reveal.d1 { transition-delay: 0.05s; }
.reveal.d2 { transition-delay: 0.11s; }
.reveal.d3 { transition-delay: 0.18s; }

/* --- Generated multipage component contract ----------------------------- */
.breadcrumbs.wrap {
  display: flex;
  min-height: 43px;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
}

.breadcrumbs.wrap > span[aria-hidden="true"] {
  color: var(--accent);
}

.breadcrumbs.wrap > span[aria-current="page"] {
  color: var(--ink);
}

.breadcrumbs.wrap a {
  color: var(--ink-2);
  text-decoration: none;
}

.breadcrumbs.wrap a:hover { color: var(--ink); }

.hero-first { border-top: 0; }

.section-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.family-card {
  position: relative;
  min-width: 0;
  min-height: 250px;
  padding: 21px;
  border-right: 1px solid var(--rule);
  background: rgba(246, 243, 238, 0.55);
  background: color-mix(in oklab, var(--ground) 78%, transparent);
  text-decoration: none;
  transition: background-color 0.16s var(--ease);
}

.family-card:last-child { border-right: 0; }

.family-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s var(--ease);
}

.family-card:hover,
.family-card:focus-visible { background: var(--accent-wash); }
.family-card:hover::after,
.family-card:focus-visible::after { transform: scaleX(1); }

.family-count {
  display: block;
  margin-bottom: 38px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.family-card h3 {
  font-family: var(--serif);
  font-size: clamp(20px, 2.5vw, 27px);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.family-card p {
  margin: 11px 0 24px;
  color: var(--ink-2);
  font-size: 14px;
}

.family-card .text-link {
  position: absolute;
  right: 21px;
  bottom: 20px;
  left: 21px;
}

.platform-card.panel {
  padding-bottom: 22px;
}

.platform-card.panel::before,
.platform-card.panel::after {
  width: 9px;
  height: 9px;
  background: transparent;
}

.platform-card.panel > h3,
.platform-card.panel > p,
.platform-card.panel > ul,
.platform-card.panel > a {
  margin-inline: 22px;
}

.platform-card.panel > h3 {
  margin-top: 24px;
  font-size: clamp(25px, 3vw, 34px);
}

.platform-card.panel > p {
  margin-top: 11px;
  color: var(--ink-2);
}

.platform-card.panel > .text-link { margin-top: auto; }

.signal-list,
.check-list,
.cross-list,
.guarantee-list,
.failure-list {
  display: grid;
  gap: 0;
  margin: 18px 0 22px;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.signal-list li,
.check-list li,
.cross-list li,
.guarantee-list li,
.failure-list li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 14px;
}

.signal-list li::before,
.check-list li::before,
.guarantee-list li::before {
  position: absolute;
  left: 1px;
  color: var(--verified);
  content: "\2713";
  font-family: var(--mono);
}

.cross-list li::before,
.failure-list li::before {
  position: absolute;
  left: 1px;
  color: var(--blocked);
  content: "\00D7";
  font-family: var(--mono);
}

.status-badge.status-available,
.status-badge.status-shipped,
.status-badge.status-verified {
  border-color: var(--verified);
  background: var(--verified-wash);
  color: var(--verified);
}

.status-badge.status-preview,
.status-badge.status-planned,
.status-badge.status-wip {
  border-color: var(--preview);
  background: var(--preview-wash);
  color: var(--preview);
}

.status-badge.status-blocked,
.status-badge.status-unavailable {
  border-color: var(--blocked);
  background: var(--blocked-wash);
  color: var(--blocked);
}

.status-badge > span[aria-hidden="true"] {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.status-badge::before { display: none; }

.install-callout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
  padding: clamp(24px, 4vw, 38px);
}

.install-callout > * { min-width: 0; }

.install-callout h2 {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: clamp(27px, 3.8vw, 40px);
  letter-spacing: -0.015em;
  line-height: 1.06;
}

.install-callout p:not(.lab) { margin-top: 10px; color: var(--ink-2); }
.install-callout .cmdrow:last-of-type { margin-bottom: 14px; }

.page-hero .hero-index.panel {
  position: relative;
  z-index: 0;
  top: auto;
  right: auto;
  display: grid;
  padding: 0;
  color: var(--ink);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  line-height: normal;
  user-select: auto;
}

.hero-index.panel > .lab {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
}

.hero-index.panel > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
}

.hero-index.panel > div:last-child { border-bottom: 0; }

.hero-index.panel b {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
}

.hero-index.panel span:not(.lab) {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
}

.phase-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(122px, 1fr));
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  scrollbar-width: thin;
}

.phase-stage {
  position: relative;
  min-width: 122px;
  padding: 16px 14px 18px;
  border-right: 1px solid var(--rule);
  text-decoration: none;
  transition: background-color 0.16s var(--ease);
}

.phase-stage:last-child { border-right: 0; }
.phase-stage:hover { background: var(--accent-wash); }

.phase-stage > span {
  display: block;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phase-stage code {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.phase-stage p {
  margin-top: 7px;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.4;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.detail-block {
  min-width: 0;
  padding: 21px;
  border-right: 1px solid var(--rule);
  background: rgba(246, 243, 238, 0.5);
  background: color-mix(in oklab, var(--ground) 80%, transparent);
}

.detail-grid > .detail-block:last-child { border-right: 0; }

.detail-number {
  display: block;
  margin-bottom: 28px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.detail-block h3 {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.detail-block > p {
  margin-top: 9px;
  color: var(--ink-2);
  font-size: 14px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.stat {
  min-height: 132px;
  padding: 18px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.stat:nth-child(2n) { border-right: 0; }
.stat:nth-last-child(-n + 2) { border-bottom: 0; }

.stat b {
  display: block;
  color: var(--accent);
  font-family: var(--mono);
  font-size: clamp(31px, 5vw, 48px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 20px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skill-card > code {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 14.5px;
  font-weight: 600;
}

.skill-card > h3 {
  margin-bottom: 9px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -0.01em;
}

.skill-card > .text-link {
  margin-top: 18px;
}

.version {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.skill-hero .hero-meta,
.plugin-hero .hero-meta {
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0 0 18px;
  border: 0;
}

.skill-hero .hero-meta > *,
.plugin-hero .hero-meta > * {
  min-width: 0;
  flex: none;
  padding: 0;
  border: 0;
}

.skill-hero h1 code {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82em;
  letter-spacing: -0.05em;
}

.skill-instrument {
  overflow: hidden;
  background: var(--ground-2);
}

.instrument-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.skill-instrument .workflow-rail {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  list-style: none;
}

.rail-step {
  position: relative;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  gap: 11px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
}

.rail-step:last-child { border-bottom: 0; }

.rail-step > span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
}

.rail-step > p {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.4;
}

.use-grid,
.output-grid,
.evidence-grid,
.install-grid,
.comparison-cards {
  display: grid;
  gap: 16px;
}

.use-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.output-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.install-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.comparison-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.use-grid > .detail-block,
.output-grid > .detail-block,
.install-card,
.comparison-cards > article {
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: rgba(246, 243, 238, 0.5);
  background: color-mix(in oklab, var(--ground) 80%, transparent);
}

.use-grid > .detail-block,
.output-grid > .detail-block { padding: 21px; }

.use-grid > .detail-block h3,
.output-grid > .detail-block h3 {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.evidence-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--ground-2);
  text-decoration: none;
  transition: border-color 0.16s var(--ease), background-color 0.16s var(--ease);
}

a.evidence-card:hover { border-color: var(--verified); background: var(--verified-wash); }

.status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--verified);
  box-shadow: 0 0 0 4px var(--verified-wash);
}

.evidence-card code {
  min-width: 0;
  flex: 1;
  color: var(--ink);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.evidence-card > span:last-child {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.evidence-procedural > div b {
  font-family: var(--mono);
  font-size: 12px;
}

.evidence-procedural > div p {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 13px;
}

.install-card {
  display: flex;
  min-width: 0;
  min-height: 230px;
  flex-direction: column;
  padding: 20px;
}

.install-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.install-card h3 {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.15;
}

.install-card > p {
  margin-bottom: 18px;
  color: var(--ink-2);
  font-size: 14px;
}

.install-card .cmdrow,
.install-card .text-link { margin-top: auto; }

.install-card .cmdrow code { font-size: 10.5px; }

.related-card > code {
  display: block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.related-card > span:last-child {
  display: block;
  margin-top: 14px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
}

.page-nav.wrap {
  margin-block: clamp(42px, 6vw, 72px);
  padding-inline: 0;
}

.page-nav a > span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-nav a > b {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}

.comparison-table {
  width: 100%;
  border: 1px solid var(--rule);
  border-collapse: collapse;
  font-size: 14px;
}

.comparison-table th,
.comparison-table td {
  padding: 15px 17px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.comparison-table th:last-child,
.comparison-table td:last-child { border-right: 0; }
.comparison-table tbody tr:last-child > * { border-bottom: 0; }

.comparison-table thead th {
  background: var(--ground-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comparison-table tbody th {
  min-width: 160px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.chip-grid a {
  min-width: 0;
  padding: 12px 10px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.chip-grid a:nth-child(6n) { border-right: 0; }
.chip-grid a:nth-last-child(-n + 6) { border-bottom: 0; }
.chip-grid a:hover { background: var(--accent-wash); }

.callout:has(> .stamp) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: clamp(22px, 4vw, 34px);
  border-left-width: 1px;
  background: var(--ground-2);
}

.callout:has(> .stamp)::before { display: none; }

.callout > div > h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 34px);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.callout > div > p { margin-top: 7px; color: var(--ink-2); }
.stamp-ok { border-color: var(--verified); color: var(--verified); transform: rotate(-1deg); }
.stamp-wip { border-color: var(--preview); color: var(--preview); transform: rotate(-1deg); }

.release-panel {
  padding: 24px;
}

.release-panel > .lab { margin-top: 26px; }

.release-panel > strong {
  display: block;
  margin-top: 8px;
  color: var(--preview);
  font-family: var(--mono);
  font-size: 13px;
}

.release-panel ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 20px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.release-panel li {
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
}

.roadmap-list {
  display: grid;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  list-style: none;
}

.roadmap-list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 15px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--rule);
}

.roadmap-list li:last-child { border-bottom: 0; }
.roadmap-list span { color: var(--accent); font-family: var(--mono); font-size: 11px; }
.roadmap-list p { color: var(--ink-2); }

.comparison-cards > article {
  padding: 21px;
}

.comparison-cards h3 {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.comparison-cards p { margin-top: 8px; color: var(--ink-2); font-size: 14px; }

.not-found {
  display: flex;
  min-height: calc(100vh - var(--header-h) - 130px);
  align-items: center;
  text-align: center;
}

.not-found > .wrap {
  max-width: 760px;
}

.not-found-code {
  color: var(--accent);
  font-family: var(--mono);
  font-size: clamp(100px, 22vw, 220px);
  font-weight: 600;
  letter-spacing: -0.1em;
  line-height: 0.72;
}

.not-found h1 {
  margin-top: 20px;
  font-family: var(--serif);
  font-size: clamp(34px, 5.5vw, 56px);
  line-height: 1.04;
}

.not-found p:not(.lab) {
  max-width: 46ch;
  margin: 14px auto 0;
  color: var(--ink-2);
}

.not-found .hero-actions { justify-content: center; margin-top: 26px; }

.site-footer .footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(240px, 1fr) auto;
  align-items: end;
  gap: 28px;
}

.site-footer .footer-grid > div:first-child p {
  margin-top: 8px;
  color: var(--ink-2);
  font-family: var(--body);
  font-size: 14px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 18px;
}

.footer-meta {
  white-space: nowrap;
}

/* Optional naming aliases used by hand-authored extension pages. */
.platform-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 3vw, 28px); }
.evidence-card,
.use-card,
.install-card { position: relative; }
.copy-row { display: flex; align-items: stretch; overflow: hidden; border: 1px solid var(--rule); background: var(--ground-2); }
.copy-row pre,
.copy-row code { min-width: 0; flex: 1; margin: 0; padding: 14px 16px; overflow-x: auto; }
.copy-row button { border: 0; border-left: 1px solid var(--rule); background: transparent; color: var(--ink-2); font-family: var(--mono); font-size: 11px; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 920px) {
  .hgrid,
  .page-hero-grid,
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .herohead,
  .page-hero-copy { max-width: 64ch; }

  .detail-grid,
  .skill-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .detail-aside,
  .skill-aside {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
  }

  .aside-nav,
  .toc { margin-top: 0; }

  .family-grid,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .family-card:nth-child(2n),
  .detail-grid > .detail-block:nth-child(2n) { border-right: 0; }

  .family-card:nth-child(-n + 2),
  .detail-grid > .detail-block:nth-child(-n + 2) { border-bottom: 1px solid var(--rule); }

  .output-grid,
  .install-grid { grid-template-columns: 1fr; }

  .install-card { min-height: 0; }

  .chip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chip-grid a:nth-child(6n) { border-right: 1px solid var(--rule); }
  .chip-grid a:nth-child(3n) { border-right: 0; }
  .chip-grid a:nth-last-child(-n + 6) { border-bottom: 1px solid var(--rule); }
  .chip-grid a:nth-last-child(-n + 3) { border-bottom: 0; }

  .site-footer .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr);
    align-items: start;
  }

  .footer-meta { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .contract3,
  .ruled-grid.cols-3 { grid-template-columns: 1fr; }

  .contract3 > *,
  .ruled-grid.cols-3 > * {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .contract3 > *:last-child,
  .ruled-grid.cols-3 > *:last-child { border-bottom: 0; }

  .related-grid,
  .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .install-callout { grid-template-columns: minmax(0, 1fr); }

  .callout:has(> .stamp) {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .callout:has(> .stamp) > .btn {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  :root { --header-h: 58px; }

  .brand,
  .site-brand { font-size: 13px; }

  .js .nav-toggle { display: block; margin-left: auto; }

  .bar .wrap,
  .site-header .header-inner,
  .site-header > .wrap { gap: 10px; }

  .bar nav,
  .site-nav {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding-block: 9px;
  }

  .js .bar nav,
  .js .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: clamp(20px, 5vw, 40px);
    left: clamp(20px, 5vw, 40px);
    display: grid;
    width: auto;
    max-height: calc(100vh - var(--header-h) - 24px);
    gap: 0;
    padding: 8px;
    overflow-y: auto;
    border: 1px solid var(--rule);
    background: var(--ground);
    box-shadow: var(--shadow-float);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition:
      opacity 0.18s var(--ease),
      transform 0.18s var(--ease);
    visibility: hidden;
  }

  .js .bar nav[data-open="true"],
  .js .site-nav[data-open="true"],
  .js .bar nav.is-open,
  .js .site-nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    visibility: visible;
  }

  .js .bar nav a,
  .js .site-nav a {
    min-height: 42px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--rule);
  }

  .js .bar nav a:last-of-type,
  .js .site-nav a:last-of-type { border-bottom: 0; }

  .js .site-nav a[aria-current="page"]::after,
  .js .site-nav a[aria-current="true"]::after {
    top: 9px;
    right: auto;
    bottom: 9px;
    left: 0;
    width: 2px;
    height: auto;
  }

  .themebtn,
  .theme-toggle { min-height: 40px; }

  .matrix th,
  .matrix td,
  .compare-table th,
  .compare-table td,
  .data-table th,
  .data-table td { padding: 13px; }

  .fails,
  .contract,
  .ruled-grid,
  .catalog-group,
  .cat,
  .skill-grid,
  .io-grid,
  .guarantee-grid,
  .feature-grid,
  .platform-grid,
  .plugin-grid { grid-template-columns: 1fr; }

  .family-grid,
  .detail-grid,
  .use-grid,
  .evidence-grid,
  .comparison-cards,
  .platform-split { grid-template-columns: 1fr; }

  .family-card,
  .detail-grid > .detail-block {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .family-card:last-child,
  .detail-grid > .detail-block:last-child { border-bottom: 0; }

  .fails > *,
  .contract:not(.contract3) > *,
  .ruled-grid.cols-2 > *,
  .cat .row2,
  .catalog-group .skill-card {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .fails > *:last-child,
  .contract:not(.contract3) > *:last-child,
  .ruled-grid.cols-2 > *:last-child,
  .cat .row2:last-child,
  .catalog-group .skill-card:last-child { border-bottom: 0; }

  .catalog-head,
  .cat-h {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .detail-aside,
  .skill-aside { grid-template-columns: 1fr; }

  .workflow-rail.vertical .workflow-step {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .workflow-rail.vertical .workflow-step p {
    grid-column: 2;
    margin-top: 6px;
  }

  .site-footer .footer-grid { grid-template-columns: 1fr; }
  .footer-meta { grid-column: auto; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }

  .brand span,
  .site-brand span { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }

  .hero-meta > *,
  .meta-strip > * { flex-basis: 50%; border-bottom: 1px solid var(--rule); }
  .hero-meta > *:nth-child(2n),
  .meta-strip > *:nth-child(2n) { border-right: 0; }
  .hero-meta > *:nth-last-child(-n + 2),
  .meta-strip > *:nth-last-child(-n + 2) { border-bottom: 0; }

  .related-grid,
  .link-grid { grid-template-columns: 1fr; }

  .chip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chip-grid a:nth-child(3n) { border-right: 1px solid var(--rule); }
  .chip-grid a:nth-child(2n) { border-right: 0; }
  .chip-grid a:nth-last-child(-n + 3) { border-bottom: 1px solid var(--rule); }
  .chip-grid a:nth-last-child(-n + 2) { border-bottom: 0; }

  .release-panel ul { grid-template-columns: 1fr; }

  .roadmap-list li {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding-inline: 14px;
  }

  .page-nav,
  .prev-next { grid-template-columns: 1fr; }
  .page-nav a + a,
  .prev-next a + a { border-top: 1px solid var(--rule); border-left: 0; }

  .cmdrow code,
  .command-row code { font-size: 12px; }

  footer .wrap,
  .site-footer .footer-inner,
  .site-footer > .wrap { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 420px) {
  .brand span,
  .site-brand span { max-width: 145px; }
  .themebtn .theme-word,
  .theme-toggle .theme-word { display: none; }
  .btn,
  .button { width: 100%; }
  .cmdrow .cp,
  .command-row .copy,
  .copy-button { min-width: 58px; padding-inline: 10px; }
}

/* --- Motion, contrast, and print ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal.pre { opacity: 1; transform: none; }
  .caret { animation: none; }
}

@media (forced-colors: active) {
  .panel::before,
  .panel::after,
  .instrument-panel::before,
  .instrument-panel::after,
  .skill-card::before,
  .row2::before { background: CanvasText; border-color: CanvasText; }
  .status,
  .status-badge,
  .badge { forced-color-adjust: none; }
}

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; font-size: 11pt; }
  header.bar,
  .site-header,
  .breadcrumbs,
  .breadcrumb,
  footer,
  .site-footer,
  .themebtn,
  .theme-toggle,
  .nav-toggle,
  .copy-button,
  .cp { display: none !important; }
  section,
  .section { padding-block: 24px; break-inside: avoid; }
  .reveal,
  .reveal.pre { opacity: 1 !important; transform: none !important; }
  a { text-decoration: none; }
  a[href^="http"]::after { color: #555; content: " (" attr(href) ")"; font-family: var(--mono); font-size: 8pt; }
  .panel,
  .skill-card,
  .platform-card,
  .plugin-card,
  .related-card { break-inside: avoid; }
}

/* --- Original visual grammar: multipage readability ---------------------
 * Keep the established measurement grid, ruled surfaces, type families, and
 * rust instrumentation. New page components must use body-sized type for
 * information; micro-mono remains metadata only.
 */
.page-hero .hero-index.panel {
  align-self: center;
  background: var(--ground-2);
}

.hero-index.panel > .lab {
  padding: 14px 18px;
  font-size: 12px;
}

.hero-index.panel > div {
  min-height: 47px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
}

.hero-index.panel b {
  font-size: 11.5px;
  letter-spacing: 0.05em;
}

.hero-index.panel span:not(.lab) {
  color: var(--ink);
  font-family: var(--body);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.35;
}

.phase-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: visible;
}

.phase-stage {
  min-width: 0;
  min-height: 128px;
  padding: 21px 20px 22px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.phase-stage:nth-child(4n) { border-right: 0; }
.phase-stage:nth-last-child(-n + 4) { border-bottom: 0; }

.phase-stage > span {
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.phase-stage code {
  margin-top: 11px;
  overflow-wrap: normal;
  font-size: 15px;
  line-height: 1.35;
  white-space: nowrap;
}

.phase-stage p {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
}

.phase-strip + .loopnote {
  margin-top: 0;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-top: 0;
  background: var(--ground-2);
  color: var(--ink-2);
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.5;
}

.phase-strip + .loopnote b {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.instrument-top {
  align-items: flex-start;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.45;
}

.instrument-top > span:last-child {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.rail-step {
  padding-block: 12px;
}

.rail-step > p {
  color: var(--ink-2);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 920px) {
  .phase-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .phase-stage,
  .phase-stage:nth-child(4n),
  .phase-stage:nth-last-child(-n + 4) {
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
  }

  .phase-stage:nth-child(2n) { border-right: 0; }
  .phase-stage:nth-last-child(-n + 2) { border-bottom: 0; }

  .detail-grid { gap: 0; }
}

@media (max-width: 600px) {
  .phase-strip { grid-template-columns: 1fr; }

  .phase-stage,
  .phase-stage:nth-child(2n),
  .phase-stage:nth-child(4n),
  .phase-stage:nth-last-child(-n + 2),
  .phase-stage:nth-last-child(-n + 4) {
    display: grid;
    min-height: 0;
    grid-template-columns: 74px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 16px;
    padding: 17px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .phase-stage:last-child { border-bottom: 0; }

  .phase-stage > span {
    grid-row: 1 / span 2;
    align-self: start;
    padding-top: 2px;
  }

  .phase-stage code {
    grid-column: 2;
    margin-top: 0;
  }

  .phase-stage p {
    grid-column: 2;
    margin-top: 4px;
  }

  .phase-strip + .loopnote {
    display: block;
    padding: 15px 18px;
  }

  .phase-strip + .loopnote b {
    display: block;
    margin-bottom: 5px;
  }

  .how-matrix,
  .how-matrix tbody,
  .how-matrix tr,
  .how-matrix td {
    display: block;
    width: 100%;
  }

  .how-matrix {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .how-matrix thead {
    display: none;
  }

  .how-matrix tbody {
    display: grid;
    gap: 12px;
  }

  .how-matrix tr {
    border: 1px solid var(--rule);
    background: color-mix(in oklab, var(--ground) 80%, transparent);
  }

  .how-matrix td,
  .how-matrix tbody tr:last-child td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    padding: 13px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    font-size: 14px;
    line-height: 1.45;
  }

  .how-matrix td:last-child,
  .how-matrix tbody tr:last-child td:last-child { border-bottom: 0; }

  .how-matrix td::before {
    color: var(--ink-2);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .how-matrix td:nth-child(1)::before { content: "Mechanism"; }
  .how-matrix td:nth-child(2)::before { content: "Enforces"; }
  .how-matrix td:nth-child(3)::before { content: "Evidence"; }

  .how-matrix code,
  .how-matrix .mono {
    overflow-wrap: anywhere;
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .brand span,
  .site-brand span { max-width: 175px; }
}

/* --- Full-pipeline handoff ----------------------------------------------
 * Installation is incomplete until the user can see what to invoke next.
 * This stays inside the original ruled-panel vocabulary.
 */
.runner-block {
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: color-mix(in oklab, var(--ground) 82%, transparent);
}

.runner-block-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--ground-2);
}

.runner-block-head > p:last-child {
  color: var(--ink-2);
  font-size: 14px;
}

.runner-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.runner-block-home .runner-command-grid,
.runner-block-single .runner-command-grid {
  grid-template-columns: minmax(0, 1fr);
}

.runner-command-card {
  min-width: 0;
  padding: 15px 16px 16px;
  border-right: 1px solid var(--rule);
}

.runner-command-card:last-child { border-right: 0; }

.runner-platform {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 14px;
}

.runner-platform > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--rule);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
}

.runner-platform > b { font-weight: 600; }

.runner-command-card .cmdrow {
  margin: 11px 0 9px;
}

.runner-command-card .cmdrow code {
  font-size: 12.5px;
}

.runner-command-card > p {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.45;
}

.runner-block-home {
  max-width: 620px;
  margin-top: 28px;
}

.runner-block-home + .hero-actions { margin-top: 16px; }

.runner-block-after-install { margin-top: 22px; }

.runner-block-after-install + .chip-grid { margin-top: 24px; }

@media (max-width: 760px) {
  .runner-command-grid { grid-template-columns: 1fr; }

  .runner-command-card {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .runner-command-card:last-child { border-bottom: 0; }
}

@media (max-width: 420px) {
  .runner-block-head { display: block; }
  .runner-block-head > p:last-child { margin-top: 5px; }
  .runner-command-card { padding-inline: 13px; }
  .runner-command-card .cmdrow code { font-size: 11.5px; }
}
