/* rpc-project theme: colors come from the logo (indigo client node, mint server node). */

:root {
  --rp-ink: #161a3a;        /* deep indigo-navy, the "wire" background */
  --rp-ink-2: #20255a;
  --rp-indigo: #5b6cf0;     /* client / local */
  --rp-indigo-soft: #e8eafe;
  --rp-mint: #22d3a6;       /* server / remote */
  --rp-mint-deep: #0f8f6f;
  --rp-paper: #f5f6fb;
  --rp-slate: #5d6280;

  --md-text-font: "IBM Plex Sans";
  --md-code-font: "JetBrains Mono";
}

[data-md-color-scheme] {
  --md-footer-bg-color: var(--rp-ink);
  --md-footer-bg-color--dark: #0d1030;
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: var(--rp-ink);
  --md-primary-fg-color--light: var(--rp-ink-2);
  --md-primary-fg-color--dark: #0d1030;
  --md-accent-fg-color: var(--rp-indigo);
  --md-typeset-a-color: #3f4fd6;
  --md-default-bg-color: #ffffff;
  --md-code-bg-color: var(--rp-paper);
}

[data-md-color-scheme="slate"] {
  --md-hue: 234;
  --md-primary-fg-color: var(--rp-ink);
  --md-primary-fg-color--light: var(--rp-ink-2);
  --md-primary-fg-color--dark: #0d1030;
  --md-accent-fg-color: var(--rp-mint);
  --md-typeset-a-color: #8f9bff;
  --md-default-bg-color: #12152e;
  --md-code-bg-color: #1a1e40;
}

/* ---------- Type ---------- */

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-header__title,
.rp-hero__title {
  font-family: "Bricolage Grotesque", var(--md-text-font-family);
  font-optical-sizing: auto;
}
.md-typeset h1 { font-weight: 700; letter-spacing: -0.02em; color: var(--md-default-fg-color); }
.md-typeset h2 { font-weight: 650; letter-spacing: -0.01em; }
.md-typeset h3 { font-weight: 600; }
.md-header__title { font-weight: 650; }

/* Inline code reads as an address on the wire: indigo on a faint tint. */
.md-typeset :not(pre) > code {
  color: #3a47b8;
  background: var(--rp-indigo-soft);
  border-radius: 4px;
}
[data-md-color-scheme="slate"] .md-typeset :not(pre) > code {
  color: #b9c0ff;
  background: #262b5c;
}

/* Header and tabs share the ink band; a mint hairline marks the remote edge. */
.md-header { box-shadow: none; border-bottom: 2px solid var(--rp-mint); }
.md-tabs { background: var(--rp-ink); }
.md-header[data-md-state="shadow"] { box-shadow: 0 2px 12px rgba(10, 12, 40, .25); }

/* ---------- Landing hero ---------- */

.rp-hero {
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.07) 1px, transparent 0) 0 0 / 22px 22px,
    var(--rp-ink);
  color: #e9ebff;
  padding: 3.2rem 0 3.6rem;
}
.rp-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 2.8rem;
  align-items: center;
  padding: 0 1rem;
}
.rp-hero__mark { display: block; margin-bottom: 1.2rem; }
.rp-hero__title {
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  color: #fff;
  max-width: 16ch;
}
.rp-hero__lede {
  font-size: .9rem;
  line-height: 1.6;
  color: #c3c7ea;
  max-width: 34rem;
  margin: 0 0 1.6rem;
}
.rp-hero__lede code {
  font-family: var(--md-code-font-family);
  font-size: .85em;
  color: var(--rp-mint);
}

.rp-install {
  display: flex;
  align-items: center;
  gap: .6rem;
  max-width: 30rem;
  padding: .55rem .55rem .55rem .9rem;
  border: 1px solid #343a7a;
  border-radius: 8px;
  background: #0f1230;
  font-family: var(--md-code-font-family);
  font-size: .72rem;
}
.rp-install__prompt { color: var(--rp-mint); }
.rp-install code { flex: 1; min-width: 0; color: #fff; background: none; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.rp-install code::-webkit-scrollbar { display: none; }
.rp-install__copy {
  font: inherit;
  font-size: .65rem;
  color: #c3c7ea;
  border: 1px solid #343a7a;
  border-radius: 5px;
  padding: .25rem .6rem;
  cursor: pointer;
  background: transparent;
}
.rp-install__copy:hover { color: #fff; border-color: var(--rp-indigo); }
.rp-install__copy:focus-visible,
.rp-hero .md-button:focus-visible { outline: 2px solid var(--rp-mint); outline-offset: 2px; }

.rp-hero__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.rp-hero .md-button {
  font-size: .75rem;
  border-radius: 8px;
  padding: .55em 1.2em;
  color: #e9ebff;
  border-color: #4a51a0;
}
.rp-hero .md-button--primary {
  background: var(--rp-mint);
  border-color: var(--rp-mint);
  color: var(--rp-ink);
  font-weight: 600;
}
.rp-hero .md-button:hover { border-color: var(--rp-mint); color: #fff; }
.rp-hero .md-button--primary:hover { background: #4be3bb; color: var(--rp-ink); }

/* The console window: the one memorable thing on the page. */
.rp-term {
  margin: 0;
  border-radius: 12px;
  background: #0b0e26;
  border: 1px solid #2c3270;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
  overflow: hidden;
  min-width: 0;
}
.rp-term__bar {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .6rem .9rem;
  border-bottom: 1px solid #22275e;
  background: #12163a;
  font-family: var(--md-code-font-family);
  font-size: .62rem;
  color: #8d93c4;
}
.rp-term__title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-term__target { color: var(--rp-mint); white-space: nowrap; }
.rp-term__link { display: inline-flex; align-items: center; }
.rp-term__node { width: 9px; height: 9px; display: inline-block; }
.rp-term__node--local { border-radius: 50%; background: var(--rp-indigo); }
.rp-term__node--remote { border-radius: 2px; background: var(--rp-mint); }
.rp-term__wire {
  width: 22px; height: 2px; margin: 0 3px;
  background: linear-gradient(90deg, var(--rp-indigo), var(--rp-mint));
}
.rp-term__body {
  margin: 0;
  padding: 1rem 1.1rem 1.2rem;
  font-family: var(--md-code-font-family);
  font-size: .7rem;
  line-height: 1.75;
  color: #e4e7ff;
  overflow-x: auto;
  background: none;
}
.rp-term__body code { background: none; padding: 0; color: inherit; font-size: inherit; }
.rp-l { white-space: pre; }
.rp-in { color: var(--rp-indigo); font-weight: 600; }
.rp-out { color: var(--rp-mint); font-weight: 600; }
.rp-str { color: #ffcf8a; }
.rp-num { color: #ff9ec7; }
.rp-caret {
  display: inline-block; width: .55em; height: 1.1em; vertical-align: -.2em;
  background: var(--rp-mint);
  animation: rp-blink 1.1s steps(1) infinite;
}

/* Single orchestrated moment: the session plays out line by line, once. */
@media (prefers-reduced-motion: no-preference) {
  .rp-term .rp-l { opacity: 0; animation: rp-type .01s linear forwards; }
  .rp-term .rp-l:nth-child(1)  { animation-delay: .25s; }
  .rp-term .rp-l:nth-child(2)  { animation-delay: .65s; }
  .rp-term .rp-l:nth-child(3)  { animation-delay: 1.15s; }
  .rp-term .rp-l:nth-child(4)  { animation-delay: 1.55s; }
  .rp-term .rp-l:nth-child(5)  { animation-delay: 2.05s; }
  .rp-term .rp-l:nth-child(6)  { animation-delay: 2.45s; }
  .rp-term .rp-l:nth-child(7)  { animation-delay: 2.85s; }
  .rp-term .rp-l:nth-child(8)  { animation-delay: 3.2s; }
  .rp-term .rp-l:nth-child(9)  { animation-delay: 3.7s; }
  .rp-term .rp-l:nth-child(10) { animation-delay: 4.05s; }
  .rp-term .rp-l:nth-child(11) { animation-delay: 4.45s; }
}
@media (prefers-reduced-motion: reduce) {
  .rp-caret { animation: none; }
}
@keyframes rp-type { to { opacity: 1; } }
@keyframes rp-blink { 50% { opacity: 0; } }

/* The markdown H1 on the home page duplicates the hero title; keep it for search/llms.txt only. */
.md-typeset .rp-home > h1:first-of-type { display: none; }

/* ---------- Home: client ↔ server flow ---------- */

.md-typeset .rp-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  margin: 1.2rem 0 2rem;
}
.md-typeset .rp-flow__side {
  padding: .9rem 1.1rem;
  border: 1.5px solid var(--rp-indigo);
  border-radius: 44px 10px 10px 44px;
  padding-left: 1.6rem;
}
.md-typeset .rp-flow__side--remote {
  border-color: var(--rp-mint);
  border-radius: 10px;
  padding-left: 1.1rem;
}
.md-typeset .rp-flow__side p { margin: .2rem 0; }
.md-typeset .rp-flow__wire {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 7rem;
  position: relative;
}
.md-typeset .rp-flow__wire::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--rp-indigo), var(--rp-mint));
}
.md-typeset .rp-flow__wire span {
  position: relative;
  font-family: var(--md-code-font-family);
  font-size: .6rem;
  padding: .1rem .45rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color--light);
}

/* ---------- Home: nested capability scopes ---------- */

.md-typeset .rp-scope {
  border-radius: 14px;
  padding: 1rem 1.2rem 1.1rem;
  margin-top: .8rem;
}
.md-typeset .rp-scope ul { margin: .3rem 0 .4rem; columns: 2 18rem; column-gap: 2rem; }
.md-typeset .rp-scope li { margin-bottom: .25rem; break-inside: avoid; }
.md-typeset .rp-scope__name {
  font-family: "Bricolage Grotesque", var(--md-text-font-family);
  font-weight: 650;
  font-size: .95rem;
  margin: 0 0 .2rem;
}
.md-typeset .rp-scope--all {
  border: 1.5px solid #c9cdf2;
  background: var(--rp-paper);
}
.md-typeset .rp-scope--darwin {
  border: 1.5px solid var(--rp-indigo);
  background: #fff;
}
.md-typeset .rp-scope--ios {
  border: 1.5px solid var(--rp-mint);
  background: #effcf7;
}
[data-md-color-scheme="slate"] .md-typeset .rp-scope--all { background: #171b3d; border-color: #343a7a; }
[data-md-color-scheme="slate"] .md-typeset .rp-scope--darwin { background: #1d2250; }
[data-md-color-scheme="slate"] .md-typeset .rp-scope--ios { background: #15343a; }

/* ---------- Home: next steps ---------- */

.md-typeset .rp-next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0;
  border-top: 1.5px solid var(--md-default-fg-color--lightest);
  margin-top: .8rem;
}
.md-typeset .rp-next p { margin: 0; }
.md-typeset .rp-next a {
  display: block;
  height: 100%;
  padding: .9rem 1rem 1rem 0;
  color: var(--md-default-fg-color--light);
  border-bottom: 1.5px solid var(--md-default-fg-color--lightest);
}
.md-typeset .rp-next a strong {
  font-family: "Bricolage Grotesque", var(--md-text-font-family);
  font-size: .95rem;
  color: var(--md-typeset-a-color);
}
.md-typeset .rp-next a:hover strong { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive ---------- */

@media screen and (max-width: 60em) {
  .rp-hero__inner { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .rp-hero { padding: 2.2rem 0 2.6rem; }
}
@media screen and (max-width: 40em) {
  .md-typeset .rp-flow { grid-template-columns: 1fr; }
  .md-typeset .rp-flow__wire { min-height: 2.6rem; }
  .md-typeset .rp-flow__wire::before { left: 50%; right: auto; top: 0; bottom: 0; width: 2px; height: auto;
    background: linear-gradient(180deg, var(--rp-indigo), var(--rp-mint)); }
  .md-typeset .rp-flow__side { border-radius: 18px; padding-left: 1.1rem; }
  .md-typeset .rp-scope { padding: .8rem .8rem .9rem; }
}
