/* OpenPI Blueprint Design System · main.css
 * 99.99% faithful implementation of OpenPI design language
 * Warm cream canvas (#f6f5f0), 30px blueprint grid, Instrument Serif + Space Grotesk + Inter + JetBrains Mono, #124b68 blue
 */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--paper);
  background-image:
    linear-gradient(rgba(18, 17, 14, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 17, 14, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection {
  background: var(--blue);
  color: var(--paper);
}

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

/* paper grain noise overlay */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

/* top scroll progress bar */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--blue);
  z-index: 60;
  pointer-events: none;
  transition: width 0.08s ease-out;
}

main {
  position: relative;
  z-index: 1;
}

/* ---------- nav ---------- */
nav, .mast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(246, 245, 240, 0.88);
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  animation: navin 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

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

.nav-inner, .mast-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand, .mast-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.pi-logo-nav, .brand-logo-nav {
  height: 20px;
  width: auto;
  vertical-align: -4px;
  margin: 0 3px;
}

.brand-name, .mast-title {
  font-family: var(--grot);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.brand-name em {
  font-family: var(--serif-en);
  font-style: italic;
  font-weight: 400;
}

.nav-links, .mast-nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  align-items: center;
}

.nav-links a, .mast-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.04em;
  transition: color 0.25s;
  white-space: nowrap;
}

.nav-links a:hover, .mast-nav a:hover {
  color: var(--ink);
}

.nav-links a.active, .nav-links a.nav-link-active,
.mast-nav a.active, .mast-nav a.nav-link-active {
  color: var(--ink);
  font-weight: 500;
}

.nav-links a.active::before, .nav-links a.nav-link-active::before,
.mast-nav a.active::before, .mast-nav a.nav-link-active::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  margin-right: 7px;
  vertical-align: 2px;
}

.nav-cta, .button-nav-cta {
  font-family: var(--mono);
  font-size: 11.5px !important;
  color: var(--paper) !important;
  background: var(--ink) !important;
  padding: 8px 16px !important;
  border-radius: 999px !important;
  transition: background 0.25s, transform 0.2s !important;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-cta:hover, .button-nav-cta:hover {
  background: var(--blue) !important;
  transform: translateY(-1px);
}

.nav-cta::before, .button-nav-cta::before {
  display: none !important;
}

@media (max-width: 960px) {
  .nav-links a:not(.nav-cta):not(:nth-child(-n+3)),
  .mast-nav a:not(.nav-cta):not(:nth-child(-n+3)) {
    display: none;
  }
}

@media (max-width: 680px) {
  .nav-links a:not(.nav-cta),
  .mast-nav a:not(.nav-cta) {
    display: none;
  }
}

/* ---------- animations & staging ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeup 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeup {
  to { opacity: 1; transform: none; }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- hero ---------- */
.hero {
  min-height: 94vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 100px;
  padding-bottom: clamp(32px, 4vw, 56px);
  position: relative;
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  width: 100%;
}

.hero-eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-bottom: 22px;
  border-bottom: 1px solid var(--ink);
}

.hero-marquee {
  overflow: hidden;
  margin: clamp(20px, 3vw, 34px) 0 0;
}

.hero-marquee-track {
  display: flex;
  width: max-content;
  animation: hero-marquee-slide 28s linear infinite;
}

.hero-marquee:hover .hero-marquee-track {
  animation-play-state: paused;
}

@keyframes hero-marquee-slide {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

.wordmark-unit {
  font-family: var(--grot);
  font-weight: 700;
  font-size: clamp(64px, 14.5vw, 190px);
  letter-spacing: -0.045em;
  line-height: 0.94;
  white-space: nowrap;
  padding-right: 0.3em;
}

.wordmark-unit em {
  font-family: var(--serif-en);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.03em;
  position: relative;
  display: inline-block;
  padding: 0 0.04em;
}

.pi-logo-hero, .brand-logo-hero {
  height: 0.82em;
  width: auto;
  display: inline-block;
  vertical-align: -0.06em;
  margin: 0 4px;
}

.wordmark-unit em::after {
  content: "";
  position: absolute;
  left: -0.02em;
  right: -0.02em;
  top: 58%;
  height: 32%;
  background: var(--yellow-mark);
  z-index: -1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  border-top: 1px solid var(--rule);
  margin-top: clamp(24px, 3.2vw, 42px);
  padding-top: clamp(20px, 2.8vw, 36px);
}

.hero-promise {
  font-family: var(--serif-en);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.22;
  letter-spacing: 0.005em;
  font-style: italic;
}

.hero-promise i {
  color: var(--blue);
  font-style: italic;
}

.hero-slogans {
  margin-top: clamp(22px, 3vw, 38px);
}

.hero-slogans span {
  display: block;
  font-family: var(--serif-en);
  font-style: italic;
  font-size: clamp(19px, 2.2vw, 28px);
  line-height: 1.65;
  color: var(--ink);
}

.hero-slogans span:nth-child(2) { margin-left: 1.1em; color: var(--ink-soft); }
.hero-slogans span:nth-child(3) { margin-left: 2.2em; color: var(--ink-faint); }
.hero-slogans i { color: var(--blue); }

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 26px;
  justify-content: space-between;
}

.hero-sub {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
  max-width: 32em;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.hero-meta b {
  color: var(--ink-soft);
  font-weight: 500;
}

.hero-meta a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-dark);
  padding-bottom: 1px;
  transition: color 0.25s, border-color 0.25s;
}

.hero-meta a:hover {
  color: var(--blue);
  border-color: var(--blue);
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ---------- terminal cards ---------- */
.term, .terminal-block {
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--paper-2);
  overflow: hidden;
  box-shadow: 0 1px 0 var(--rule), 0 20px 44px -24px rgba(18, 17, 14, 0.28);
  margin: 24px 0;
  scroll-margin-top: 96px;
}

.term-bar, .terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule-dark);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.term-bar .dot, .terminal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  display: inline-block;
  margin-right: 8px;
  vertical-align: 1px;
}

.term-body {
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 2;
  min-height: 150px;
  white-space: pre-wrap;
}

.term-body .t-cmd { color: var(--ink); }
.term-body .t-cmd::before { content: "$ "; color: var(--blue); }
.term-body .t-ok { color: var(--blue-ink); }
.term-body .t-out { color: var(--ink-soft); }

.caret {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--blue);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 0.9s steps(1) infinite;
}

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

pre {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  overflow-x: auto;
  background: transparent;
  color: var(--ink);
}

code {
  font-family: var(--mono);
  font-size: 12.5px;
}

.tok-prm { color: var(--blue); font-weight: 500; margin-right: 8px; }
.tok-cmd { color: var(--ink); font-weight: 600; }
.tok-kw { color: var(--blue-ink); font-weight: 500; }
.tok-path { color: var(--ink-soft); }
.tok-cmt { color: var(--ink-faint); font-style: italic; display: block; margin-top: 6px; }
.tok-str { color: #2e7d32; }
.tok-num { color: var(--blue); }

/* ---------- install command box ---------- */
.install-cmd {
  font-family: var(--mono);
  font-size: 13.5px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  background: var(--paper);
  width: fit-content;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.install-cmd:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

.install-cmd .prompt {
  color: var(--blue);
  user-select: none;
}

.copy-btn {
  background: none;
  border: none;
  border-left: 1px solid var(--rule);
  color: var(--ink-faint);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  padding: 2px 0 2px 12px;
  transition: color 0.25s;
}

.copy-btn:hover {
  color: var(--blue);
}

/* ---------- marquee ---------- */
.marquee {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
  padding: 15px 0;
  background: var(--paper-2);
  margin: 40px 0 0;
}

.marquee-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: marquee-slide 36s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-track span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
  padding: 0 18px;
}

.marquee-track span i {
  font-style: normal;
  color: var(--blue);
  padding-left: 36px;
}

@keyframes marquee-slide {
  to { transform: translateX(-50%); }
}

/* ---------- sections & headings ---------- */
section {
  position: relative;
  scroll-margin-top: 72px;
}

.sec-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 10vw, 130px) var(--pad);
  position: relative;
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 18px;
  margin-bottom: clamp(36px, 4.5vw, 56px);
}

.sec-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue);
  letter-spacing: 0.14em;
}

.sec-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sec-head .spacer {
  flex: 1;
}

.sec-ghost {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: clamp(15px, 1.6vw, 19px);
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

h1, h2, h3, h4 {
  font-weight: normal;
}

h1 {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: clamp(38px, 5.2vw, 68px);
  line-height: 1.12;
  letter-spacing: 0.004em;
  margin-bottom: 18px;
}

h1 i, h2 i, h3 i {
  color: var(--blue);
  font-style: italic;
}

h2 {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.16;
  letter-spacing: 0.004em;
  margin: 36px 0 16px;
  text-wrap: balance;
}

h3 {
  font-family: var(--grot);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 28px 0 12px;
  color: var(--ink);
}

.sec-lede, .lede {
  margin-top: 20px;
  color: var(--ink-soft);
  max-width: 44em;
  font-size: 16.5px;
  line-height: 1.85;
}

.sec-lede strong, .lede strong {
  color: var(--ink);
  font-weight: 500;
}

.pull-quote {
  margin-top: clamp(40px, 4.8vw, 60px);
  margin-bottom: clamp(32px, 4vw, 48px);
  padding: clamp(24px, 3vw, 38px) 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule-dark);
  text-align: center;
  font-family: var(--serif-en);
  font-style: italic;
  font-size: clamp(22px, 2.8vw, 32px);
  line-height: 1.5;
  color: var(--ink);
}

.pull-quote i {
  color: var(--blue);
  font-style: italic;
}

/* ---------- spec table ---------- */
.spec {
  margin-top: clamp(36px, 4.5vw, 56px);
  border-top: 1px solid var(--rule-dark);
}

.spec-row {
  display: grid;
  grid-template-columns: 0.5fr 1.1fr 1fr 1.25fr;
  border-bottom: 1px solid var(--rule);
  transition: background 0.3s;
  align-items: baseline;
}

.spec-row:hover {
  background: var(--paper-2);
}

.spec-row > div {
  padding: 20px 22px 20px 0;
}

.spec-row > div + div {
  padding-left: 22px;
  border-left: 1px solid var(--rule);
}

.spec-idx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue);
}

.spec-head {
  border-bottom: 1px solid var(--rule-dark);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.spec-head > div {
  padding-top: 14px;
  padding-bottom: 14px;
}

.spec-head:hover {
  background: none;
}

.spec-scene {
  font-weight: 500;
  font-size: 15px;
}

.spec-cell {
  color: var(--ink-soft);
  font-size: 14.5px;
}

.spec-cell em {
  color: var(--ink);
  font-style: normal;
  font-weight: 500;
}

@media (max-width: 900px) {
  .spec-row { grid-template-columns: 1fr; }
  .spec-row > div { padding: 8px 0; }
  .spec-row > div + div { border-left: none; padding-left: 0; }
  .spec-row > div:first-child { padding-top: 18px; }
  .spec-row > div:last-child { padding-bottom: 18px; }
  .spec-head, .spec-idx { display: none; }
}

/* ---------- editorial paths (3 columns) ---------- */
.paths {
  margin-top: clamp(36px, 4.5vw, 56px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule-dark);
}

.path-col {
  padding: 32px 28px 8px 0;
  border-bottom: 1px solid var(--rule);
}

.path-col + .path-col {
  padding-left: 28px;
  border-left: 1px solid var(--rule);
}

.path-num {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 44px;
  color: var(--blue);
  line-height: 1;
  display: block;
}

.path-en {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
  display: block;
  margin: 18px 0 12px;
}

.path-name {
  font-family: var(--serif-en);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.005em;
  line-height: 1.35;
}

.path-desc {
  margin-top: 12px;
  padding-bottom: 28px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.85;
}

.path-desc code, p code, li code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue-ink);
  background: rgba(18, 75, 104, 0.08);
  padding: 1.5px 5px;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .paths { grid-template-columns: 1fr; }
  .path-col + .path-col { padding-left: 0; border-left: none; }
}

/* ---------- feature strip (4 columns) ---------- */
.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--rule);
}

.strip > div {
  padding: 22px 24px 26px 0;
}

.strip > div + div {
  padding-left: 24px;
  border-left: 1px solid var(--rule);
}

.strip b {
  display: block;
  font-weight: 500;
  font-size: 14.5px;
  margin-bottom: 6px;
}

.strip span {
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.7;
  display: block;
}

@media (max-width: 900px) {
  .strip { grid-template-columns: 1fr 1fr; }
  .strip > div:nth-child(3) { padding-left: 0; border-left: none; }
}

/* ---------- surface list (2 columns) ---------- */
.surface-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--rule-dark);
  margin-top: clamp(36px, 4.5vw, 56px);
}

.surface-item {
  padding: 26px 30px 30px 0;
  border-bottom: 1px solid var(--rule);
}

.surface-item:nth-child(even) {
  padding-left: 30px;
  padding-right: 0;
  border-left: 1px solid var(--rule);
}

.surface-item b {
  display: block;
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 8px;
}

.surface-item b i {
  color: var(--blue);
  font-style: normal;
  margin-right: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.surface-item span {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
}

@media (max-width: 760px) {
  .surface-list { grid-template-columns: 1fr; }
  .surface-item:nth-child(even) { padding-left: 0; border-left: none; }
}

/* ---------- routing lines ---------- */
.routing {
  margin-top: clamp(36px, 4.5vw, 56px);
  border-top: 1px solid var(--rule-dark);
}

.route-line {
  display: grid;
  grid-template-columns: 1.4fr auto 1fr;
  align-items: baseline;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
  transition: background 0.3s, padding-left 0.3s;
}

.route-line:hover {
  background: var(--paper-2);
  padding-left: 12px;
}

.route-line .r-when {
  color: var(--ink-soft);
  font-size: 15.5px;
}

.route-line .r-arrow {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 14px;
}

.route-line .r-to {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink);
  text-align: right;
}

/* ---------- principles (3 columns) ---------- */
.principles {
  margin-top: clamp(36px, 4.5vw, 56px);
  border-top: 1px solid var(--rule-dark);
}

.principle {
  display: grid;
  grid-template-columns: 76px 1fr 1.5fr;
  gap: 28px;
  padding: 34px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.principle .p-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue);
  letter-spacing: 0.12em;
}

.principle h3 {
  font-family: var(--serif-en);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  margin: 0;
}

.principle p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.85;
}

@media (max-width: 860px) {
  .principle { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------- safety list ---------- */
.safety-list {
  margin-top: clamp(36px, 4.5vw, 56px);
  border-top: 1px solid var(--rule-dark);
}

.safety-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  transition: background 0.3s, padding-left 0.3s;
}

.safety-item:hover {
  background: var(--paper-2);
  padding-left: 12px;
}

.safety-item .s-key {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--blue-ink);
  letter-spacing: 0.02em;
}

.safety-item .s-val {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 760px) {
  .safety-item { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- commands table ---------- */
.cmd-list {
  margin-top: clamp(36px, 4.5vw, 56px);
  border-top: 1px solid var(--rule-dark);
}

.cmd-row {
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) 1.4fr;
  border-bottom: 1px solid var(--rule);
  transition: background 0.25s, padding-left 0.3s;
}

.cmd-row:hover {
  background: var(--paper-2);
  padding-left: 12px;
}

.cmd-row > div {
  padding: 16px 0;
}

.cmd-row .c {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink);
}

.cmd-row .c .blue {
  color: var(--blue);
}

.cmd-row .d {
  color: var(--ink-soft);
  font-size: 14px;
}

@media (max-width: 760px) {
  .cmd-row { grid-template-columns: 1fr; }
  .cmd-row .d { padding-top: 0; }
}

/* ---------- cards & badges ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 28px 0;
}

.card {
  border: 1px solid var(--rule-dark);
  border-radius: 10px;
  background: var(--paper-2);
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -12px rgba(18, 17, 14, 0.15);
}

.badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule-dark);
  background: var(--paper);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-blue {
  border-color: var(--blue);
  color: var(--blue-ink);
  background: rgba(18, 75, 104, 0.10);
}

/* ---------- buttons ---------- */
.button-primary {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.25s, transform 0.2s;
  border: none;
  cursor: pointer;
}

.button-primary:hover {
  background: var(--blue);
  transform: translateY(-1px);
}

.button-secondary {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--ink);
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule-dark);
  transition: border-color 0.25s, color 0.25s;
  cursor: pointer;
}

.button-secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.button-sm {
  padding: 6px 14px !important;
  font-size: 11px !important;
}

/* ---------- doc prose page layout ---------- */
article {
  max-width: 900px;
  margin: 0 auto;
  padding: 110px var(--pad) 80px;
}

.page-head {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 32px;
  margin-bottom: 44px;
}

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}

.prose {
  margin: 32px 0;
}

.prose p {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.85;
  margin-bottom: 20px;
}

.prose ul, .prose ol {
  margin: 16px 0 24px 20px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.prose li {
  margin-bottom: 8px;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- final section (inverted) ---------- */
.final {
  border-top: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.final .sec-inner {
  text-align: left;
  padding-top: clamp(80px, 11vw, 140px);
  padding-bottom: clamp(80px, 11vw, 140px);
}

.final .sec-num { color: var(--blue-light); }
.final .sec-tag { color: #7A7666; }
.final .sec-head { border-bottom-color: var(--paper); }
.final h2 { color: var(--paper); max-width: 22ch; }
.final h2 i { color: var(--blue-light); font-style: italic; }

.final .install-cmd {
  margin-top: 48px;
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
  font-size: 14.5px;
  padding: 15px 24px;
}

.final .install-cmd:hover {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(82, 140, 174, 0.22);
}

.final .install-cmd .prompt { color: var(--blue-light); }
.final .copy-btn { border-left-color: #3A382F; color: #7A7666; }
.final .copy-btn:hover { color: var(--blue-light); }

.final-links {
  margin-top: 36px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.final-links a {
  color: #A8A494;
  text-decoration: none;
  font-size: 13.5px;
  padding-bottom: 3px;
  background: linear-gradient(currentColor, currentColor) bottom left no-repeat;
  background-size: 100% 1px;
  transition: color 0.25s;
}

.final-links a:hover {
  color: var(--paper);
  animation: sweep 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sweep {
  from { background-size: 0% 1px; }
  to { background-size: 100% 1px; }
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--rule);
}

.foot-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 44px var(--pad) 52px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink-faint);
}

.foot-inner a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-dark);
  transition: color 0.25s;
}

.foot-inner a:hover {
  color: var(--ink);
}

.foot-note {
  width: 100%;
  font-size: 12px;
  color: #A8A494;
  margin-top: 10px;
  line-height: 1.8;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .hero-marquee-track { animation: none; }
  .marquee-track { animation: none; }
  .fade-up { opacity: 1; transform: none; }
  nav, .mast { opacity: 1; transform: none; }
}
