/* Unix Core — terminal-inspired design system */

body.unix-core {
  --ux-bg: #0d1117;
  --ux-bg-elevated: #161b22;
  --ux-bg-panel: #1c2128;
  --ux-border: #30363d;
  --ux-border-bright: #484f58;
  --ux-text: #e6edf3;
  --ux-text-muted: #8b949e;
  --ux-text-dim: #6e7681;
  --ux-green: #3fb950;
  --ux-green-dim: rgba(63, 185, 80, 0.12);
  --ux-green-glow: rgba(63, 185, 80, 0.35);
  --ux-amber: #d29922;
  --ux-amber-dim: rgba(210, 153, 34, 0.12);
  --ux-cyan: #58a6ff;
  --ux-cyan-dim: rgba(88, 166, 255, 0.12);
  --ux-red: #f85149;
  --ux-red-dim: rgba(248, 81, 73, 0.12);
  --ux-purple: #bc8cff;
  --ux-font-body: "Inter", system-ui, -apple-system, sans-serif;
  --ux-font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --ux-font-display: "Inter", system-ui, -apple-system, sans-serif;
  --ux-radius: 8px;
  --ux-radius-lg: 12px;
  --ux-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --ux-max-width: var(--ux-content-width);
  --ux-nav-height: 3.5rem;
  --ux-transition: 0.15s ease;

  /* Persona colors */
  --persona-dev: #58a6ff;
  --persona-dev-bg: rgba(88, 166, 255, 0.12);
  --persona-sysadmin: #3fb950;
  --persona-sysadmin-bg: rgba(63, 185, 80, 0.12);
  --persona-infra: #d29922;
  --persona-infra-bg: rgba(210, 153, 34, 0.12);

  /* Typography — Inter reading scale (see assets/core-typography.css) */
  --ux-font-h1: clamp(1.75rem, 1.5rem + 1.5vw, 2.5rem);
  --ux-font-h2: clamp(1.375rem, 1.2rem + 0.9vw, 1.875rem);
  --ux-font-h3: clamp(1.125rem, 1rem + 0.55vw, 1.5rem);
  --ux-font-size: clamp(1rem, 0.97rem + 0.2vw, 1.125rem);
  --ux-font-size-read: var(--ux-font-size);
  --ux-font-size-small: 0.875rem;
  --ux-font-size-table: var(--ux-font-size-small);
  --ux-font-size-code: clamp(0.8125rem, 0.78rem + 0.15vw, 0.9375rem);
  --ux-line-height: 1.75;
  --ux-line-height-read: 1.75;
  --ux-content-width: min(800px, 92vw);
  --ux-doc-width: min(800px, 92vw);
}

html[data-hp-theme="light"] body.unix-core {
  --ux-bg: #f6f8fa;
  --ux-bg-elevated: #ffffff;
  --ux-bg-panel: #eef1f5;
  --ux-border: #d0d7de;
  --ux-border-bright: #afb8c1;
  --ux-text: #1f2328;
  --ux-text-muted: #57606a;
  --ux-text-dim: #6e7781;
  --ux-green: #116329;
  --ux-green-dim: rgba(17, 99, 41, 0.1);
  --ux-green-glow: rgba(17, 99, 41, 0.2);
  --ux-amber: #9a6700;
  --ux-amber-dim: rgba(154, 103, 0, 0.1);
  --ux-cyan: #0969da;
  --ux-cyan-dim: rgba(9, 105, 218, 0.1);
  --ux-red: #cf222e;
  --ux-red-dim: rgba(207, 34, 46, 0.1);
  --ux-purple: #8250df;
  --ux-shadow: 0 8px 24px rgba(31, 35, 40, 0.08);
  --persona-dev: #0969da;
  --persona-dev-bg: rgba(9, 105, 218, 0.1);
  --persona-sysadmin: #116329;
  --persona-sysadmin-bg: rgba(17, 99, 41, 0.1);
  --persona-infra: #9a6700;
  --persona-infra-bg: rgba(154, 103, 0, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.unix-core {
  margin: 0;
  min-height: 100vh;
  background: var(--ux-bg) !important;
  color: var(--ux-text);
  font-family: var(--ux-font-body);
  font-size: var(--ux-font-size);
  line-height: var(--ux-line-height);
  -webkit-font-smoothing: antialiased;
}

/* Chapter pages — reading layout handled in assets/core-typography.css */

html[data-hp-theme="light"] body.unix-core::before {
  opacity: 0.12;
}

body.unix-core::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.4;
}

a {
  color: var(--ux-cyan);
  text-decoration: none;
  transition: color var(--ux-transition);
}

a:hover {
  color: var(--ux-green);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--ux-cyan);
  outline-offset: 2px;
  border-radius: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

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

/* ── Top bar (aligned with site-topbar + reading-room compact scroll) ── */

html:has(body.unix-core) {
  --unix-topbar-compact: 0;
}

body.unix-core {
  --unix-compact-inset: clamp(14px, 2.8vw, 24px);
}

body.unix-core .unix-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(
    in srgb,
    var(--ux-bg) calc((1 - var(--unix-topbar-compact, 0)) * 92%),
    transparent
  );
  border-bottom: 1px solid
    color-mix(
      in srgb,
      var(--ux-border) calc((1 - var(--unix-topbar-compact, 0)) * 100%),
      transparent
    );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    min-height 0.35s ease,
    box-shadow 0.35s ease,
    background 0.35s ease,
    border-color 0.35s ease;
}

body.unix-core .unix-topbar .site-topbar__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand nav actions";
  align-items: center;
  gap: 12px 20px;
  max-width: var(--site-topbar-max, 1280px);
  margin: 0 auto;
  min-height: var(--ux-nav-height);
  padding: 14px var(--site-topbar-pad-x, clamp(20px, 4vw, 40px));
  padding-left: calc(
    var(--site-topbar-pad-x, clamp(20px, 4vw, 40px)) * (1 - var(--unix-topbar-compact, 0)) +
      (env(safe-area-inset-left, 0px) + var(--unix-compact-inset)) * var(--unix-topbar-compact, 0)
  );
  transition:
    max-width 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    margin 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    gap 0.35s ease,
    min-height 0.35s ease;
}

body.unix-core .unix-topbar .site-topbar__mid {
  grid-area: nav;
  justify-self: center;
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}

body.unix-core .unix-topbar .site-topbar__inner > :not(.site-brand) {
  opacity: calc(1 - var(--unix-topbar-compact, 0));
  overflow: hidden;
  transition: opacity 0.35s ease;
}

body.unix-core.unix-topbar--compact .unix-topbar .site-topbar__inner > :not(.site-brand) {
  pointer-events: none;
}

body.unix-core.unix-topbar--compact {
  --site-topbar-sticky-offset: 3.5rem;
}

body.unix-core.unix-topbar--compact .unix-topbar {
  min-height: var(--site-topbar-sticky-offset);
}

body.unix-core.unix-topbar--compact .unix-topbar .site-topbar__inner {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  gap: calc(12px * (1 - var(--unix-topbar-compact, 1)));
  min-height: 44px;
  padding-top: max(8px, env(safe-area-inset-top, 0px));
  padding-bottom: 8px;
}

body.unix-core.unix-topbar--compact .unix-topbar .site-topbar__inner > :not(.site-brand) {
  width: 0;
  min-width: 0;
  max-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  visibility: hidden;
}

body.unix-core.unix-topbar--compact .unix-topbar .site-brand {
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: clamp(6px, 1.6vw, 10px);
  margin: 0;
  padding: 0;
  font-size: clamp(0.82rem, 2.6vw, 0.96rem);
  max-width: min(100%, 12.5rem);
}

body.unix-core.unix-topbar--compact .unix-topbar .site-brand > .site-brand__mark {
  width: 40px;
  height: 40px;
}

body.unix-core .unix-topbar .site-brand {
  grid-area: brand;
  justify-self: start;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.88rem, 3.4vw, 1.05rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  transition: column-gap 0.35s ease, color var(--ux-transition);
}

body.unix-core .unix-topbar .site-brand > span {
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
}

body.unix-core .unix-topbar .site-brand {
  color: var(--ux-text);
  text-decoration: none;
}

body.unix-core .unix-topbar .site-brand:hover {
  color: var(--ux-green);
  text-decoration: none;
}

body.unix-core .unix-topbar .site-brand__tld {
  color: var(--ux-text-muted);
}

.ux-nav {
  display: none;
  justify-self: center;
}

.ux-nav__list {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 4px 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ux-nav__link {
  display: block;
  padding: 6px 10px;
  border-radius: var(--ux-radius);
  color: var(--ux-text-muted);
  font-size: 12px;
  text-decoration: none;
  transition: color var(--ux-transition), background var(--ux-transition);
}

.ux-nav__link:hover,
.ux-nav__link[aria-current="page"] {
  color: var(--ux-green);
  background: var(--ux-green-dim);
  text-decoration: none;
}

body.unix-core .unix-topbar .hp-topbar__actions,
body.unix-core .unix-topbar .site-topbar__actions {
  grid-area: actions;
  justify-self: end;
}

@media (min-width: 900px) {
  .ux-nav {
    display: block;
  }
}

@media (max-width: 899px) {
  .ux-nav {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.unix-core .unix-topbar,
  body.unix-core .unix-topbar .site-topbar__inner,
  body.unix-core .unix-topbar .site-topbar__inner > :not(.site-brand),
  body.unix-core .unix-topbar .site-brand {
    transition: none;
  }
}

/* ── Layout ── */

.ux-main {
  max-width: var(--ux-max-width);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 32px) 64px;
}

.ux-breadcrumb {
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--ux-text-muted);
}

.ux-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ux-breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: var(--ux-text-dim);
}

.ux-breadcrumb [aria-current="page"] {
  color: var(--ux-green);
}

/* ── Hero ── */

.ux-hero {
  display: grid;
  gap: 32px;
  margin-bottom: 56px;
}

.ux-hero--solo {
  grid-template-columns: 1fr;
  max-width: 52rem;
}

@media (min-width: 860px) {
  .ux-hero:not(.ux-hero--solo) {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 40px;
  }
}

.ux-hero__kicker {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ux-green);
}

.ux-hero__title {
  margin: 0 0 16px;
  font-family: var(--ux-font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.ux-hero__title span {
  color: var(--ux-green);
}

.ux-hero__lede {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ux-text-muted);
  max-width: 52ch;
}

.ux-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ux-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--ux-radius);
  font-family: var(--ux-font-mono);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--ux-transition), border-color var(--ux-transition), color var(--ux-transition);
}

/* Isolate from site-shell global `a` link colors (especially light theme hover) */
body.unix-core a.ux-btn,
body.unix-core a.ux-btn:hover {
  border-bottom: none;
}

body.unix-core a.ux-btn--primary {
  background: var(--ux-green-dim);
  border-color: var(--ux-green);
  color: var(--ux-green);
}

body.unix-core a.ux-btn--primary:hover {
  background: var(--ux-green);
  color: var(--ux-bg);
  text-decoration: none;
}

body.unix-core a.ux-btn--ghost {
  background: transparent;
  border-color: var(--ux-border);
  color: var(--ux-text-muted);
}

body.unix-core a.ux-btn--ghost:hover {
  border-color: var(--ux-border-bright);
  color: var(--ux-text);
  text-decoration: none;
}

html[data-hp-theme="light"] body.unix-core a.ux-btn--primary {
  background: var(--ux-green);
  border-color: var(--ux-green);
  color: #f0f6f2;
}

html[data-hp-theme="light"] body.unix-core a.ux-btn--primary:hover {
  background: #094824;
  border-color: #094824;
  color: #ffffff;
}

html[data-hp-theme="light"] body.unix-core a.ux-btn--ghost {
  background: var(--ux-bg-elevated);
  border-color: var(--ux-border-bright);
  color: var(--ux-text);
}

html[data-hp-theme="light"] body.unix-core a.ux-btn--ghost:hover {
  background: var(--ux-bg-elevated);
  border-color: var(--ux-green);
  color: var(--ux-green);
}

/* ── Terminal widget ── */

.ux-terminal {
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius-lg);
  overflow: hidden;
  background: var(--ux-bg-elevated);
  box-shadow: var(--ux-shadow);
}

.ux-terminal__chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--ux-bg-panel);
  border-bottom: 1px solid var(--ux-border);
}

.ux-terminal__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ux-terminal__dot--red { background: #ff5f57; }
.ux-terminal__dot--yellow { background: #ffbd2e; }
.ux-terminal__dot--green { background: #28ca41; }

.ux-terminal__title {
  margin-left: 8px;
  font-size: 11px;
  color: var(--ux-text-dim);
}

.ux-terminal__body {
  padding: 16px;
  min-height: 280px;
  max-height: 360px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
}

.ux-terminal__output {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ux-text-muted);
}

.ux-terminal__output .ux-out--cmd {
  color: var(--ux-text);
}

.ux-terminal__output .ux-out--prompt {
  color: var(--ux-green);
}

.ux-terminal__output .ux-out--error {
  color: var(--ux-red);
}

.ux-terminal__output .ux-out--hint {
  color: var(--ux-amber);
  font-size: 12px;
}

.ux-terminal__input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--ux-border);
  background: var(--ux-bg);
}

.ux-terminal__prompt {
  color: var(--ux-green);
  font-size: 13px;
  white-space: nowrap;
  user-select: none;
}

.ux-terminal__input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ux-text);
  font-family: var(--ux-font-mono);
  font-size: 13px;
  outline: none;
}

.ux-terminal__input::placeholder {
  color: var(--ux-text-dim);
}

.ux-terminal__cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--ux-green);
  animation: ux-blink 1s step-end infinite;
  vertical-align: text-bottom;
}

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

/* ── Section headings ── */

.ux-section {
  margin-bottom: 56px;
}

.ux-section__head {
  margin-bottom: 24px;
}

.ux-section__title {
  margin: 0 0 8px;
  font-family: var(--ux-font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--ux-text);
}

.ux-section__title::before {
  content: "# ";
  color: var(--ux-green);
  font-family: var(--ux-font-mono);
  font-weight: 500;
}

.ux-section__lede {
  margin: 0;
  color: var(--ux-text-muted);
  max-width: 65ch;
  line-height: 1.7;
}

/* ── Timeline / history ── */

.ux-timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--ux-border);
  margin-left: 8px;
}

.ux-timeline__item {
  position: relative;
  padding: 0 0 28px 24px;
}

.ux-timeline__item:last-child {
  padding-bottom: 0;
}

.ux-timeline__item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ux-bg);
  border: 2px solid var(--ux-green);
}

.ux-timeline__year {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ux-amber);
}

.ux-timeline__label {
  margin: 0 0 6px;
  font-family: var(--ux-font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ux-text);
}

.ux-timeline__desc {
  margin: 0;
  font-size: 13px;
  color: var(--ux-text-muted);
  line-height: 1.65;
}

/* ── Persona badges ── */

.ux-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.ux-badge--dev {
  color: var(--persona-dev);
  background: var(--persona-dev-bg);
  border-color: rgba(88, 166, 255, 0.35);
}

.ux-badge--sysadmin {
  color: var(--persona-sysadmin);
  background: var(--persona-sysadmin-bg);
  border-color: rgba(63, 185, 80, 0.35);
}

.ux-badge--infra {
  color: var(--persona-infra);
  background: var(--persona-infra-bg);
  border-color: rgba(210, 153, 34, 0.35);
}

/* ── Topic cards grid ── */

.ux-grid {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 600px) {
  .ux-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .ux-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ux-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius-lg);
  background: var(--ux-bg-elevated);
  transition: border-color var(--ux-transition), transform var(--ux-transition), box-shadow var(--ux-transition);
}

.ux-card:hover {
  border-color: var(--ux-green);
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(63, 185, 80, 0.08);
}

.ux-card__link {
  color: inherit;
  text-decoration: none;
}

.ux-card__link:hover {
  text-decoration: none;
}

.ux-card__icon {
  font-size: 20px;
  color: var(--ux-green);
}

.ux-card__title {
  margin: 0;
  font-family: var(--ux-font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ux-text);
}

.ux-card__desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--ux-text-muted);
  line-height: 1.65;
  flex: 1;
}

.ux-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.ux-card--soon {
  opacity: 0.65;
  pointer-events: none;
}

.ux-card--soon .ux-card__soon-tag {
  font-size: 10px;
  color: var(--ux-amber);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Persona intro cards ── */

.ux-personas {
  display: grid;
  gap: 16px;
}

@media (min-width: 768px) {
  .ux-personas {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ux-persona {
  padding: 20px;
  border-radius: var(--ux-radius-lg);
  border: 1px solid var(--ux-border);
  background: var(--ux-bg-elevated);
}

.ux-persona__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.ux-persona__title {
  margin: 0;
  font-family: var(--ux-font-display);
  font-size: 14px;
  font-weight: 700;
}

.ux-persona__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--ux-text-muted);
}

.ux-persona__list li {
  padding: 4px 0;
  padding-left: 14px;
  position: relative;
}

.ux-persona__list li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--ux-green);
}

/* ── Callouts ── */

.ux-callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  margin: 20px 0;
  border-radius: var(--ux-radius);
  border: 1px solid var(--ux-border);
  font-size: 13px;
  line-height: 1.65;
}

.ux-callout--tip {
  background: var(--ux-green-dim);
  border-color: rgba(63, 185, 80, 0.3);
}

.ux-callout--warn {
  background: var(--ux-red-dim);
  border-color: rgba(248, 81, 73, 0.3);
}

.ux-callout__icon {
  flex-shrink: 0;
  font-size: 16px;
}

.ux-callout p {
  margin: 0;
  color: var(--ux-text-muted);
}

.ux-callout strong {
  color: var(--ux-text);
}

/* ── Code blocks ── */

.ux-codeblock {
  position: relative;
  margin: 16px 0;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius);
  overflow: hidden;
  background: var(--ux-bg-elevated);
}

.ux-codeblock__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--ux-bg-panel);
  border-bottom: 1px solid var(--ux-border);
}

.ux-codeblock__lang {
  font-size: 11px;
  color: var(--ux-text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ux-codeblock__copy {
  appearance: none;
  padding: 4px 10px;
  border: 1px solid var(--ux-border);
  border-radius: 4px;
  background: transparent;
  color: var(--ux-text-muted);
  font-family: var(--ux-font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: color var(--ux-transition), border-color var(--ux-transition), background var(--ux-transition);
}

.ux-codeblock__copy:hover {
  color: var(--ux-green);
  border-color: var(--ux-green);
}

.ux-codeblock__copy.is-copied {
  color: var(--ux-green);
  border-color: var(--ux-green);
}

.ux-codeblock pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
}

.ux-codeblock code {
  font-family: var(--ux-font-mono);
}

/* Inline code */
.ux-inline-code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ux-bg-panel);
  border: 1px solid var(--ux-border);
  font-size: 0.92em;
  color: var(--ux-cyan);
}

/* ── ASCII diagram box ── */

.ux-ascii {
  margin: 20px 0;
  padding: 16px;
  border: 1px dashed var(--ux-border-bright);
  border-radius: var(--ux-radius);
  background: var(--ux-bg-elevated);
  overflow-x: auto;
}

.ux-ascii pre {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ux-green);
}

/* ── Footer (site .footer + unix tokens) ── */

body.unix-core .unix-footer {
  position: relative;
  z-index: 1;
  margin-top: 64px;
  padding: 28px 24px 64px;
  border-top: 1px solid var(--ux-border);
  text-align: center;
  font-size: 11px;
  color: var(--ux-text-muted);
  background: var(--ux-bg);
}

body.unix-core .unix-footer a {
  color: var(--ux-cyan);
  border: none;
}

body.unix-core .unix-footer a:hover {
  color: var(--ux-green);
}

body.unix-core .unix-footer .footer__meta {
  color: var(--ux-text-dim);
}

body.unix-core .ux-breadcrumb {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

body.unix-core .ux-breadcrumb a {
  color: var(--ux-text-muted);
}

body.unix-core .ux-breadcrumb [aria-current="page"] {
  color: var(--ux-green);
}

/* ── Mobile nav toggle (future) ── */

.ux-mobile-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ux-border);
}

@media (min-width: 900px) {
  .ux-mobile-nav {
    display: none;
  }
}

.ux-mobile-nav a {
  padding: 6px 10px;
  border-radius: var(--ux-radius);
  font-size: 11px;
  color: var(--ux-text-muted);
  background: var(--ux-bg-elevated);
  border: 1px solid var(--ux-border);
  text-decoration: none;
}

.ux-mobile-nav a:hover {
  color: var(--ux-green);
  border-color: var(--ux-green);
  text-decoration: none;
}

/* ── Highlight.js overrides ── */

.hljs {
  background: transparent !important;
  padding: 0 !important;
}

/* ── Article / content pages ── */

.ux-page-hero {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--ux-border);
}

.ux-page-hero__title {
  margin: 0 0 12px;
  font-family: var(--ux-font-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.ux-page-hero__title::before {
  content: "$ man ";
  color: var(--ux-green);
  font-family: var(--ux-font-mono);
  font-weight: 500;
  font-size: 0.65em;
}

.ux-page-hero__lede {
  margin: 0 0 16px;
  max-width: 68ch;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ux-text-muted);
}

.ux-page-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ux-toc {
  margin: 0 0 40px;
  padding: 18px 20px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius-lg);
  background: var(--ux-bg-elevated);
}

.ux-toc__title {
  margin: 0 0 12px;
  font-family: var(--ux-font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ux-text-muted);
}

.ux-toc ol {
  margin: 0;
  padding: 0 0 0 20px;
  font-size: 13px;
  line-height: 1.8;
}

.ux-toc a {
  color: var(--ux-text-muted);
  text-decoration: none;
}

.ux-toc a:hover {
  color: var(--ux-green);
  text-decoration: underline;
}

.ux-prose h3 {
  margin: 32px 0 12px;
  font-family: var(--ux-font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ux-text);
}

.ux-prose h3::before {
  content: "## ";
  color: var(--ux-green);
  font-family: var(--ux-font-mono);
  font-weight: 500;
  font-size: 0.85em;
}

.ux-prose h4 {
  margin: 24px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ux-cyan);
}

.ux-prose p {
  margin: 0 0 16px;
  color: var(--ux-text-muted);
  line-height: 1.75;
  max-width: 72ch;
}

.ux-prose ul,
.ux-prose ol {
  margin: 0 0 20px;
  padding-left: 22px;
  color: var(--ux-text-muted);
  line-height: 1.75;
  max-width: 72ch;
}

.ux-prose li {
  margin-bottom: 6px;
}

.ux-prose li strong {
  color: var(--ux-text);
}

.ux-subsystem-grid {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

@media (min-width: 640px) {
  .ux-subsystem-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .ux-subsystem-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ux-subsystem {
  padding: 18px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius);
  background: var(--ux-bg-elevated);
}

.ux-subsystem__name {
  margin: 0 0 8px;
  font-family: var(--ux-font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ux-green);
}

.ux-subsystem__desc {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--ux-text-muted);
  line-height: 1.6;
}

.ux-subsystem__examples {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 11.5px;
  color: var(--ux-text-dim);
}

.ux-subsystem__examples li {
  padding: 2px 0;
}

.ux-subsystem__examples code {
  color: var(--ux-cyan);
  font-size: 11px;
}

.ux-table-wrap {
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius);
}

.ux-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ux-table th,
.ux-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--ux-border);
  vertical-align: top;
}

.ux-table th {
  background: var(--ux-bg-panel);
  color: var(--ux-text);
  font-weight: 600;
  white-space: nowrap;
}

.ux-table td {
  color: var(--ux-text-muted);
}

.ux-table tr:last-child td {
  border-bottom: none;
}

.ux-table code {
  font-size: 11.5px;
  color: var(--ux-cyan);
}

.ux-flow {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius-lg);
  background: var(--ux-bg-elevated);
}

.ux-flow__steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .ux-flow__steps {
    flex-direction: row;
    align-items: stretch;
  }
}

.ux-flow__step {
  flex: 1;
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius);
  background: var(--ux-bg);
}

@media (min-width: 768px) {
  .ux-flow__step:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    color: var(--ux-green);
    font-size: 16px;
    background: var(--ux-bg-elevated);
    padding: 0 2px;
  }

  .ux-flow__steps .ux-flow__step {
    border-radius: 0;
  }

  .ux-flow__steps .ux-flow__step:first-child {
    border-radius: var(--ux-radius) 0 0 var(--ux-radius);
  }

  .ux-flow__steps .ux-flow__step:last-child {
    border-radius: 0 var(--ux-radius) var(--ux-radius) 0;
  }
}

.ux-flow__label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ux-amber);
}

.ux-flow__text {
  margin: 0;
  font-size: 12px;
  color: var(--ux-text-muted);
  line-height: 1.5;
}

.ux-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--ux-border);
}

.ux-pager__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius);
  background: var(--ux-bg-elevated);
  text-decoration: none;
  max-width: 280px;
  transition: border-color var(--ux-transition);
}

.ux-pager__link:hover {
  border-color: var(--ux-green);
  text-decoration: none;
}

.ux-pager__link--next {
  margin-left: auto;
  text-align: right;
}

.ux-pager__dir {
  font-size: 11px;
  color: var(--ux-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ux-pager__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ux-text);
}

/* ── FHS directory tree ── */

.ux-fhs-tree {
  margin: 24px 0;
  padding: 16px 18px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius-lg);
  background: var(--ux-bg-elevated);
  font-size: 12.5px;
}

.ux-fhs-tree__root {
  margin: 0 0 12px;
  font-family: var(--ux-font-display);
  font-weight: 700;
  color: var(--ux-green);
}

.ux-fhs-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ux-fhs-tree > ul {
  padding-left: 0;
}

.ux-fhs-tree li {
  position: relative;
  padding: 6px 0 6px 20px;
  border-left: 1px solid var(--ux-border);
  margin-left: 8px;
}

.ux-fhs-tree > ul > li {
  border-left: none;
  padding-left: 0;
  margin-left: 0;
}

.ux-fhs-tree li:last-child {
  border-left-color: transparent;
}

.ux-fhs-tree li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 12px;
  height: 1px;
  background: var(--ux-border);
}

.ux-fhs-tree > ul > li::before {
  display: none;
}

.ux-fhs-tree__path {
  color: var(--ux-cyan);
  font-weight: 600;
}

.ux-fhs-tree__desc {
  display: block;
  margin-top: 2px;
  color: var(--ux-text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.ux-perm-demo {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

@media (min-width: 640px) {
  .ux-perm-demo {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ux-perm-demo__box {
  padding: 14px 16px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius);
  background: var(--ux-bg-elevated);
}

.ux-perm-demo__label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ux-amber);
}

.ux-perm-demo__bits {
  margin: 0;
  font-size: 13px;
  color: var(--ux-green);
  letter-spacing: 0.04em;
}

.ux-perm-demo__octal {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ux-text-dim);
}

/* ── Process state diagram ── */

.ux-state-grid {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

@media (min-width: 720px) {
  .ux-state-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ux-state-card {
  padding: 16px 18px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius);
  background: var(--ux-bg-elevated);
}

.ux-state-card__name {
  margin: 0 0 6px;
  font-family: var(--ux-font-display);
  font-size: 14px;
  font-weight: 700;
}

.ux-state-card__code {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--ux-bg-panel);
  color: var(--ux-amber);
}

.ux-state-card--run .ux-state-card__name { color: var(--ux-green); }
.ux-state-card--sleep .ux-state-card__name { color: var(--ux-cyan); }
.ux-state-card--stop .ux-state-card__name { color: var(--ux-amber); }
.ux-state-card--zombie .ux-state-card__name { color: var(--ux-red); }

.ux-state-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ux-text-muted);
  line-height: 1.6;
}

.ux-signal-table .ux-table td:first-child {
  white-space: nowrap;
  font-weight: 600;
  color: var(--ux-text);
}

/* ── Commands reference page ── */

.ux-main--commands {
  max-width: 900px;
}

.ux-cmd-toolbar {
  position: sticky;
  top: var(--ux-nav-height);
  z-index: 50;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius-lg);
  background: color-mix(in srgb, var(--ux-bg) 95%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ux-cmd-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ux-cmd-search__icon {
  color: var(--ux-green);
  font-weight: 600;
}

.ux-cmd-search {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius);
  background: var(--ux-bg);
  color: var(--ux-text);
  font-family: var(--ux-font-mono);
  font-size: 13px;
  outline: none;
}

.ux-cmd-search:focus {
  border-color: var(--ux-green);
  box-shadow: 0 0 0 2px var(--ux-green-dim);
}

.ux-cmd-search-results {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--ux-amber);
}

.ux-cmd-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ux-cmd-filter__btn {
  appearance: none;
  padding: 6px 12px;
  border: 1px solid var(--ux-border);
  border-radius: 999px;
  background: var(--ux-bg-elevated);
  color: var(--ux-text-muted);
  font-family: var(--ux-font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--ux-transition), color var(--ux-transition), background var(--ux-transition);
}

.ux-cmd-filter__btn:hover {
  border-color: var(--ux-green);
  color: var(--ux-text);
}

.ux-cmd-filter__btn.is-active {
  border-color: var(--ux-green);
  background: var(--ux-green-dim);
  color: var(--ux-green);
}

.ux-cmd-categories {
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ux-border);
  overflow-x: auto;
}

.ux-cmd-categories ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ux-cmd-categories a {
  display: block;
  padding: 5px 10px;
  border-radius: var(--ux-radius);
  font-size: 11px;
  color: var(--ux-text-muted);
  background: var(--ux-bg-elevated);
  border: 1px solid var(--ux-border);
  text-decoration: none;
  white-space: nowrap;
}

.ux-cmd-categories a:hover {
  color: var(--ux-green);
  border-color: var(--ux-green);
  text-decoration: none;
}

.ux-cmd-category {
  margin-bottom: 48px;
}

.ux-cmd-category__title {
  margin: 0 0 4px;
  font-family: var(--ux-font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ux-text);
  scroll-margin-top: calc(var(--ux-nav-height) + 120px);
}

.ux-cmd-category__title::before {
  content: "## ";
  color: var(--ux-green);
  font-family: var(--ux-font-mono);
  font-weight: 500;
  font-size: 0.85em;
}

.ux-cmd-category__count {
  margin: 0 0 24px;
  font-size: 12px;
  color: var(--ux-text-dim);
}

.ux-cmd-entry {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--ux-border);
  scroll-margin-top: calc(var(--ux-nav-height) + 100px);
}

.ux-cmd-entry:last-child {
  border-bottom: none;
}

.ux-cmd-entry[hidden] {
  display: none;
}

.ux-cmd-entry__head {
  margin-bottom: 12px;
}

.ux-cmd-entry__name {
  margin: 0 0 6px;
  font-family: var(--ux-font-display);
  font-size: 18px;
  font-weight: 700;
}

.ux-cmd-entry__name a {
  color: var(--ux-cyan);
  text-decoration: none;
}

.ux-cmd-entry__name a:hover {
  color: var(--ux-green);
}

.ux-cmd-entry__desc {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ux-text-muted);
  line-height: 1.6;
}

.ux-cmd-entry__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ux-cmd-entry__syntax {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ux-text-muted);
}

.ux-cmd-entry__syntax code {
  color: var(--ux-green);
  font-size: 12px;
}

.ux-cmd-entry__examples-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ux-text-dim);
}

.ux-cmd-entry .ux-codeblock {
  margin-bottom: 12px;
}

.ux-cmd-entry .ux-callout {
  margin-top: 12px;
  margin-bottom: 0;
}

/* ── Cheat sheets ── */

.ux-cheatsheet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.ux-cheatsheet-nav a {
  padding: 8px 14px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ux-text-muted);
  background: var(--ux-bg-elevated);
}

.ux-cheatsheet-nav a:hover {
  border-color: var(--ux-green);
  color: var(--ux-green);
  text-decoration: none;
}

.ux-cheatsheet {
  margin-bottom: 56px;
  padding: 24px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius-lg);
  background: var(--ux-bg-elevated);
  scroll-margin-top: calc(var(--ux-nav-height) + 24px);
}

.ux-cheatsheet__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ux-border);
}

.ux-cheatsheet__title {
  margin: 0;
  font-family: var(--ux-font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.ux-cheatsheet__lede {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ux-text-muted);
  max-width: 50ch;
}

.ux-cheatsheet__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ux-cheatsheet__copy {
  appearance: none;
  padding: 6px 12px;
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius);
  background: var(--ux-bg);
  color: var(--ux-text-muted);
  font-family: var(--ux-font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: color var(--ux-transition), border-color var(--ux-transition);
}

.ux-cheatsheet__copy:hover {
  color: var(--ux-green);
  border-color: var(--ux-green);
}

.ux-cheatsheet__copy.is-copied {
  color: var(--ux-green);
  border-color: var(--ux-green);
}

.ux-cheatsheet .ux-table {
  font-size: 12px;
}

.ux-cheatsheet .ux-table code {
  font-size: 11px;
  white-space: nowrap;
}

.ux-cheatsheet .ux-table td:last-child {
  color: var(--ux-text-dim);
  font-size: 11.5px;
}

.ux-cheatsheet-group {
  margin-bottom: 24px;
}

.ux-cheatsheet-group:last-child {
  margin-bottom: 0;
}

.ux-cheatsheet-group__title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ux-amber);
}

@media print {
  body.unix-core::before {
    display: none;
  }

  .ux-topbar,
  .ux-mobile-nav,
  .ux-breadcrumb,
  .ux-toc,
  .ux-cheatsheet-nav,
  .ux-cheatsheet__actions,
  .ux-pager,
  .ux-footer,
  .ux-page-hero__meta {
    display: none !important;
  }

  .ux-main {
    max-width: none;
    padding: 0;
  }

  .ux-cheatsheet {
    break-inside: avoid;
    border: 1px solid #ccc;
    background: #fff;
    margin-bottom: 24px;
  }

  .ux-cheatsheet .ux-table th,
  .ux-cheatsheet .ux-table td {
    color: #111;
    border-color: #ddd;
  }

  .ux-cheatsheet .ux-table code {
    color: #000;
  }

  .ux-page-hero__title,
  .ux-cheatsheet__title {
    color: #000;
  }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ux-terminal__cursor {
    animation: none;
  }

  .ux-card:hover {
    transform: none;
  }
}
