/* ============ site.css — additions on top of tokens.css + home.css ============ */

/* Override: force light mode, modern sans display (no Söhne / Fraunces) */
:root {
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --accent: oklch(55% 0.18 155);
  --accent-hover: oklch(48% 0.18 155);
  --accent-soft: oklch(96% 0.04 155);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #FAFAF9;
    --bg-2: #F4F3F1;
    --bg-3: #ECEAE6;
    --fg: #1A1A19;
    --fg-2: #2B2B29;
    --muted: #55554F;
    --muted-2: #6F6F6A;
    --hairline: #D8D5CF;
    --hairline-strong: #B8B4AC;
    --accent: oklch(55% 0.18 155);
    --accent-hover: oklch(48% 0.18 155);
    --accent-soft: oklch(96% 0.04 155);
  }
}

html, body { background: var(--bg); color: var(--fg); }

h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em; }
h1 { font-weight: 700; }

/* Replace serif-accent with modern-sans italic accent */
.serif-accent-alt {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
}
/* Neutralize any remaining .serif-accent uses (fall back to same treatment) */
.serif-accent {
  font-family: var(--font-display) !important;
  font-style: italic !important;
  font-weight: 500 !important;
  color: var(--accent);
}

/* Buttons override: chunkier, sans */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: 11px 18px;
  border-radius: 6px;
  letter-spacing: -0.01em;
}
.btn-primary { background: #0A0A09; border-color: #0A0A09; color: #FAFAF9; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #FAFAF9; }
.btn-secondary { background: var(--bg); color: var(--fg); border-color: var(--hairline-strong); }
.btn-secondary:hover { border-color: var(--fg); background: var(--fg); color: var(--bg); }

/* Hero caption */
.hero-caption {
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-xs);
  margin-top: var(--s-3);
  letter-spacing: 0.04em;
}
.pill.mono { background: var(--bg); }

/* Marquee content styling override */
.marquee { padding: 14px 0; background: var(--bg); }
.marquee-track { gap: 36px; font-size: var(--fs-xs); }
.marquee-track span.it { display: inline-flex; align-items: center; gap: 8px; }
.marquee-track span.it b { color: var(--fg); font-weight: 600; }
.marquee-track span.sep { color: var(--hairline-strong); }

/* ========== Split-hero footer: fix 3-col layout (override home.css phantom pseudos) ========== */
.split-footer::before,
.split-footer::after { content: none !important; display: none !important; }
.split-footer {
  display: grid !important;
  grid-template-columns: 1fr 1px 1fr !important;
}
.split-footer .sf-col.chaos { grid-column: 1; }
.split-footer .sf-divider {
  grid-column: 2;
  background: var(--hairline);
  min-width: 1px;
  width: 1px;
  padding: 0;
}
.split-footer .sf-col.order { grid-column: 3 !important; }
.split-footer .sf-col {
  padding: 16px 22px !important;
  display: flex !important;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  min-width: 0;
}
.split-footer .sf-col .sf-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.split-footer .sf-verdict {
  flex: 1 1 100%;
  text-align: left;
  padding-left: 0;
  padding-top: 6px;
  border-top: 1px dashed var(--hairline);
  margin-top: 4px;
}
@media (max-width: 900px) {
  .split-footer { grid-template-columns: 1fr !important; }
  .split-footer .sf-divider { display: none !important; }
  .split-footer .sf-col.order { grid-column: 1 !important; border-top: 1px solid var(--hairline); }
}

/* ========== INSTALL ========== */
.install-wrap {
  margin-top: var(--s-5);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 20px 40px -24px rgba(10,10,9,.08);
}
.install-langs {
  display: flex;
  gap: 2px;
  padding: 10px 10px 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.install-lang {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 10px 14px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  top: 1px;
  transition: all 150ms;
}
.install-lang .lk {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg-3);
  border-radius: 3px;
  color: var(--muted-2);
}
.install-lang:hover { color: var(--fg); }
.install-lang.active {
  background: var(--bg);
  color: var(--fg);
  border-color: var(--hairline);
  border-bottom-color: var(--bg);
}
.install-lang.active .lk { background: var(--accent); color: #FAFAF9; }

.install-panels {
  padding: var(--s-6) var(--s-5) var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.install-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--s-4);
  align-items: start;
  padding-bottom: var(--s-5);
  border-bottom: 1px dashed var(--hairline);
}
.install-step:last-of-type { border-bottom: 0; padding-bottom: 0; }
.install-step .is-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 36px;
  color: var(--accent);
  line-height: 1;
  padding-top: 4px;
}
.install-step h4 {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--fg);
}
.install-step .is-sub {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-bottom: var(--s-3);
  max-width: 620px;
}

.install-code {
  margin: 0;
  background: #0A0A09;
  color: #E8E6E1;
  border: 1px solid #1C1C1A;
  border-radius: 6px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
}
.install-code .c { color: #6A6A65; font-style: italic; }
.install-code .k { color: oklch(72% 0.14 270); }
.install-code .s { color: oklch(78% 0.14 140); }
.install-code .n { color: oklch(75% 0.14 80); }
.install-code .f { color: oklch(75% 0.12 200); }
.install-code .p { color: oklch(80% 0.08 60); }
.install-code[hidden] { display: none; }

/* Adapters */
.adapters {
  margin-top: var(--s-3);
  padding: var(--s-5);
  background: var(--bg-2);
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  margin-left: calc(-1 * var(--s-5));
  margin-right: calc(-1 * var(--s-5));
  margin-bottom: calc(-1 * var(--s-5));
}
.adapters h5 {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: var(--s-3);
}
.adapter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.adapter {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 150ms;
}
.adapter:hover { border-color: var(--accent); transform: translateY(-1px); }
.adapter .mk {
  color: var(--fg);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.adapter .t {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 900px) {
  .adapter-grid { grid-template-columns: repeat(2, 1fr); }
  .install-step { grid-template-columns: 1fr; gap: var(--s-2); }
}

/* ========== USE CASES ========== */
.usecase-tabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  margin-bottom: var(--s-5);
  overflow-x: auto;
}
.usecase-tab {
  flex: 1;
  min-width: fit-content;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  transition: all 180ms;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.usecase-tab .num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
}
.usecase-tab .lbl {
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
}
.usecase-tab:hover { background: var(--bg-2); color: var(--fg); }
.usecase-tab.active {
  background: #0A0A09;
  color: #FAFAF9;
}
.usecase-tab.active .num { color: oklch(72% 0.14 155); }

.usecase-panel {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  min-height: 460px;
  display: grid;
  grid-template-columns: 360px 1px 1fr;
  gap: 0;
}
.uc-side {
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  background: var(--bg-2);
}
.uc-divider { background: var(--hairline); }
.uc-main {
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.uc-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.uc-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
}
.uc-desc {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.uc-stats {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--hairline);
}
.uc-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.uc-stat .v {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.uc-stat .l {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Use-case call+receipt */
.uc-call {
  background: #0A0A09;
  color: #E8E6E1;
  border-radius: 6px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  border: 1px solid #1C1C1A;
  white-space: pre;
  overflow-x: auto;
}
.uc-call .c { color: #6A6A65; font-style: italic; }
.uc-call .k { color: oklch(72% 0.14 270); }
.uc-call .s { color: oklch(78% 0.14 140); }
.uc-call .n { color: oklch(75% 0.14 80); }

.uc-wire {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3);
  background: var(--bg-2);
  border: 1px dashed var(--hairline-strong);
  border-radius: 6px;
}
.uc-wire .node {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.uc-wire .node .n {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--fg);
  display: block;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.uc-wire .node .m {
  color: var(--muted);
  font-size: 10px;
}
.uc-wire .arrow {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  min-width: 120px;
  padding: 4px 8px;
  border-top: 1px solid var(--accent);
  position: relative;
}
.uc-wire .arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--accent);
}
.uc-wire .arrow b {
  display: block;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.uc-receipt {
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
}
.uc-receipt .r-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--hairline);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}
.uc-receipt .r-head .sig {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  font-weight: 500;
}
.uc-receipt .r-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
}
.uc-receipt .r-row .k { color: var(--muted); }
.uc-receipt .r-row .v { color: var(--fg); }
.uc-receipt .r-row .v b { color: var(--accent); font-weight: 500; }

@media (max-width: 1000px) {
  .usecase-panel { grid-template-columns: 1fr; }
  .uc-divider { display: none; }
  .uc-side { border-bottom: 1px solid var(--hairline); }
  .usecase-tabs { flex-wrap: wrap; }
  .usecase-tab { flex: 1 1 30%; }
}

/* ========== STACK ========== */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
  margin-top: var(--s-5);
  background: var(--bg);
}
.stack-cell {
  padding: var(--s-4) var(--s-5);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: background 150ms;
}
.stack-cell:hover { background: var(--bg-2); }
.stack-cell:nth-child(3n) { border-right: 0; }
.stack-cell:nth-last-child(-n+3) { border-bottom: 0; }
.stack-cell .sc-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 40px;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}
.stack-cell h4 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--fg);
}
.stack-cell p {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}
.stack-cell code.mono {
  display: inline-block;
  font-size: 11px;
  padding: 4px 8px;
  background: var(--bg-3);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  color: var(--fg-2);
  align-self: flex-start;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .stack-grid { grid-template-columns: 1fr; }
  .stack-cell { border-right: 0 !important; border-bottom: 1px solid var(--hairline) !important; }
  .stack-cell:last-child { border-bottom: 0 !important; }
}

/* ========== FINAL CTA override ========== */
.cta-final {
  background: #0A0A09;
  color: #F2F1EE;
  padding: var(--s-8) 0 var(--s-7);
}
.cta-final .eyebrow.soft { color: oklch(72% 0.14 155); }
.cta-final h2 { color: #F2F1EE; letter-spacing: -0.03em; }
.cta-final h2 .serif-accent-alt { color: oklch(72% 0.14 155); }
.cta-final p { color: color-mix(in srgb, #F2F1EE 75%, transparent); }

.cta-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-6);
  align-items: start;
  position: relative;
  z-index: 1;
}
.cta-copy { max-width: 560px; }
.cta-copy h2 { font-size: clamp(2rem, 3.6vw, 2.8rem); line-height: 1.08; margin-bottom: var(--s-3); }
.cta-copy p { margin-bottom: 0; font-size: var(--fs-md); }

.cta-cards {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.cta-card {
  padding: var(--s-4);
  border: 1px solid #2A2A28;
  border-radius: 8px;
  background: #141413;
  text-decoration: none;
  color: #E8E6E1;
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto auto;
  gap: 4px 14px;
  transition: all 150ms;
}
.cta-card:hover {
  border-color: oklch(72% 0.14 155);
  background: #1C1C1A;
  transform: translateY(-2px);
  color: #F2F1EE;
}
.cta-card .cc-num {
  grid-row: 1 / span 3;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 32px;
  color: oklch(72% 0.14 155);
  line-height: 1;
}
.cta-card h4 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: #F2F1EE;
  margin: 0;
}
.cta-card p {
  color: color-mix(in srgb, #F2F1EE 65%, transparent);
  font-size: var(--fs-sm);
  margin: 0;
}
.cta-card .cc-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: oklch(72% 0.14 155);
  letter-spacing: 0.04em;
  margin-top: 6px;
}
.cta-card.primary {
  background: linear-gradient(135deg, oklch(42% 0.14 155), oklch(32% 0.12 155));
  border-color: oklch(45% 0.15 155);
}
.cta-card.primary .cc-num,
.cta-card.primary .cc-cta { color: #F2F1EE; }
.cta-card.primary p { color: color-mix(in srgb, #F2F1EE 85%, transparent); }
.cta-card.primary:hover { background: linear-gradient(135deg, oklch(46% 0.15 155), oklch(36% 0.13 155)); }

.cta-foot {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid #2A2A28;
  font-size: 11px;
  color: #8B8B85;
  letter-spacing: 0.04em;
}
.cta-foot a { color: oklch(72% 0.14 155); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, oklch(72% 0.14 155) 40%, transparent); }

@media (max-width: 900px) {
  .cta-inner { grid-template-columns: 1fr; gap: var(--s-5); }
}

/* ========== FOOTER ========== */
.footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; }
.footer-brand .logo {
  display: inline-flex;
  margin-bottom: var(--s-3);
  font-size: var(--fs-lg);
}
.footer-brand .f-tag {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
  margin-bottom: var(--s-3);
  max-width: 320px;
}
.footer-brand .f-meta {
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

/* Fix: existing .flow-section.dark overrides serif-accent — re-hit .serif-accent-alt in dark */
.flow-section.dark .serif-accent-alt { color: oklch(72% 0.14 155); }

/* ========== RAILS MATRIX ========== */
.rails-wrap {
  margin-top: var(--s-5);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.rails-nav {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--hairline);
}
.rail-btn {
  padding: 14px 10px 12px;
  border: 0;
  border-right: 1px solid var(--hairline);
  background: var(--bg);
  cursor: pointer;
  font-family: var(--font-display);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: all 180ms;
  min-width: 0;
}
.rail-btn:last-child { border-right: 0; }
.rail-btn:hover { background: var(--bg-2); }
.rail-btn .rb-key {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rail-btn .rb-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--fg);
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-btn.active { background: #0A0A09; }
.rail-btn.active .rb-key { color: oklch(72% 0.14 155); }
.rail-btn.active .rb-name { color: #F2F1EE; }
.rail-btn.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: oklch(72% 0.14 155);
}

.rails-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
}
.rails-call {
  padding: var(--s-5);
  background: var(--bg);
  border-right: 1px solid var(--hairline);
}
.rc-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--hairline);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rc-head .k { color: var(--accent); }
.rails-code {
  margin: 0;
  background: #0A0A09;
  color: #E8E6E1;
  border-radius: 6px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre;
  overflow-x: auto;
  border: 1px solid #1C1C1A;
}
.rails-code .c { color: #6A6A65; font-style: italic; }
.rails-code .k { color: oklch(72% 0.14 270); }
.rails-code .s { color: oklch(78% 0.14 140); transition: background 400ms; }
.rails-code .n { color: oklch(75% 0.14 80); }
.rails-code .f { color: oklch(75% 0.12 200); }
.rails-code .highlight { background: oklch(45% 0.18 155); padding: 0 2px; border-radius: 2px; animation: highlight-fade 800ms ease-out; }
@keyframes highlight-fade {
  from { background: oklch(55% 0.2 155); }
  to { background: transparent; }
}

.rails-detail {
  padding: var(--s-5);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.rd-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--fg);
}
.rd-desc {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.rd-props {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
}
.rd-props .prop {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rd-props .prop .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.rd-props .prop .v {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--fg);
}
.rd-props .prop .v.accent { color: var(--accent); }
.rd-example {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px dashed var(--hairline);
  line-height: 1.6;
}
.rd-example b { color: var(--fg); font-weight: 500; }

@media (max-width: 1100px) {
  .rails-nav { grid-template-columns: repeat(5, 1fr); }
  .rail-btn:nth-child(5) { border-right: 0; }
  .rail-btn:nth-child(n+6) { border-top: 1px solid var(--hairline); }
  .rails-body { grid-template-columns: 1fr; }
  .rails-call { border-right: 0; border-bottom: 1px solid var(--hairline); }
}
@media (max-width: 640px) {
  .rails-nav { grid-template-columns: repeat(2, 1fr); }
  .rail-btn { border-right: 1px solid var(--hairline); }
  .rail-btn:nth-child(2n) { border-right: 0; }
  .rail-btn:nth-child(n+3) { border-top: 1px solid var(--hairline); }
}

/* ========== DISPUTE FSM ========== */
.fsm-wrap {
  margin-top: var(--s-5);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--s-5);
  align-items: stretch;
}
.fsm-graph {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: var(--s-4);
  min-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fsm-graph svg { width: 100%; height: auto; max-height: 460px; display: block; }
.fsm-node rect {
  fill: var(--bg-2);
  stroke: var(--hairline);
  stroke-width: 1;
  transition: all 200ms;
  cursor: pointer;
}
.fsm-node:hover rect { stroke: var(--fg); }
.fsm-node.active rect {
  fill: #0A0A09;
  stroke: var(--accent);
  stroke-width: 2;
}
.fsm-node.terminal.ok rect { fill: color-mix(in srgb, var(--accent) 8%, var(--bg)); border-color: var(--accent); }
.fsm-node.terminal.bad rect { fill: #FFF3EF; }
.fsm-node text.fsm-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  fill: var(--fg);
  pointer-events: none;
  letter-spacing: -0.01em;
}
.fsm-node.active text.fsm-label { fill: #F2F1EE; }
.fsm-node text.fsm-num {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--muted);
  letter-spacing: 0.08em;
  pointer-events: none;
}
.fsm-node.active text.fsm-num { fill: oklch(72% 0.14 155); }
.fsm-edge {
  stroke: var(--hairline-strong);
  stroke-width: 1;
  fill: none;
  marker-end: url(#fsm-arrow);
  transition: stroke 200ms;
}
.fsm-edge.active { stroke: var(--accent); stroke-width: 1.6; }
.fsm-edge-label {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--muted);
  pointer-events: none;
}

.fsm-detail {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.fsm-detail .fd-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.fsm-detail .fd-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--fg);
}
.fsm-detail .fd-desc {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.fsm-detail .fd-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: var(--s-3);
  border-top: 1px dashed var(--hairline);
}
.fsm-detail .fd-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  font-size: var(--fs-sm);
}
.fsm-detail .fd-row .k {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 3px;
}
.fsm-detail .fd-row .v { color: var(--fg); font-size: 13px; }
.fsm-detail .fd-row .v b { color: var(--accent); font-weight: 500; }
.fsm-detail .fd-row .v .tx {
  display: inline-block;
  padding: 2px 7px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  margin-right: 4px;
  margin-bottom: 4px;
}

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

/* ========== ECOSYSTEM ========== */
.eco-grid {
  margin-top: var(--s-5);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}
.eco-card {
  padding: var(--s-5);
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  transition: all 180ms;
}
.eco-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -20px color-mix(in srgb, var(--accent) 25%, transparent);
}
.eco-head {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  padding-bottom: var(--s-3);
  border-bottom: 1px dashed var(--hairline);
}
.eco-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: #0A0A09;
  color: #F2F1EE;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.eco-mark i {
  font-style: italic;
  font-weight: 500;
  color: oklch(72% 0.14 155);
  font-size: 14px;
  letter-spacing: -0.02em;
}
.eco-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.eco-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  font-weight: 500;
}
.eco-layer {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.eco-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.18;
  color: var(--fg);
}
.eco-title .accent {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}
.eco-body {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.58;
}
.eco-snippet {
  background: #0A0A09;
  color: #E8E6E1;
  border-radius: 6px;
  border: 1px solid #1C1C1A;
  overflow: hidden;
}
.eco-snippet pre {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}
.eco-snippet .c { color: #6A6A65; font-style: italic; }
.eco-snippet .k { color: oklch(72% 0.14 270); }
.eco-snippet .s { color: oklch(78% 0.14 140); }
.eco-snippet .n { color: oklch(75% 0.14 80); }
.eco-snippet .f { color: oklch(75% 0.12 200); }
.eco-foot {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: var(--s-2);
  border-top: 1px dashed var(--hairline);
  margin-top: auto;
}
.eco-chip {
  padding: 3px 9px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* eco arch */
.eco-arch {
  margin-top: var(--s-6);
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: var(--s-5);
  align-items: start;
  padding: var(--s-5);
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.eco-arch-title .eyebrow { margin-bottom: var(--s-2); display: block; }
.eco-arch-title p {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.eco-arch-layers {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
}
.eco-layer-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--s-3);
  padding: 12px 16px;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
}
.eco-layer-row:last-child { border-bottom: 0; }
.eco-layer-row.accent {
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}
.eco-layer-row .eco-layer-name {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.eco-layer-row.accent .eco-layer-name { color: var(--accent); font-weight: 600; }
.eco-layer-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.eco-layer-chips .cc {
  padding: 4px 10px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 12px;
  color: var(--fg);
}
.eco-layer-chips .cc.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #FAFAF9;
  font-weight: 600;
}
.eco-layer-chips .cc-note {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

@media (max-width: 1000px) {
  .eco-grid { grid-template-columns: 1fr; }
  .eco-arch { grid-template-columns: 1fr; }
  .eco-layer-row { grid-template-columns: 1fr; gap: 6px; }
}
