/* The Team pages. Tokens, nav, buttons and footer are index.html's, so the site looks like one thing. */
:root {
  --bg: #000; --alt: #101012; --tile: #1a1a1c; --line: #2c2c2f;
  --text: #f5f5f7; --muted: #a1a1a6; --dim: #8e8e93;
  --accent: #0a84ff; --btn: #0071e3; --btn-hover: #0062c4; --link: #0a84ff;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fff; --alt: #f5f5f7; --tile: #fff; --line: #d2d2d7;
  --text: #1d1d1f; --muted: #6e6e73; --dim: #6e6e73;
  --accent: #0066cc; --btn: #0066cc; --btn-hover: #0055aa; --link: #0066cc;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fff; --alt: #f5f5f7; --tile: #fff; --line: #d2d2d7;
    --text: #1d1d1f; --muted: #6e6e73; --dim: #6e6e73;
    --accent: #0066cc; --btn: #0066cc; --btn-hover: #0055aa; --link: #0066cc;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.47 var(--sans); letter-spacing: -.022em; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
button, input { font-family: var(--sans); }
code { font-family: var(--mono); letter-spacing: 0; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--btn); color: #fff; padding: 10px 14px; border-radius: 99px; z-index: 20; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.wrap { max-width: 1024px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 820px; }

.nav { position: sticky; top: 0; z-index: 10; height: 52px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.nav .wrap { display: flex; align-items: center; height: 100%; gap: 28px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 19px; font-weight: 600; letter-spacing: -.02em; margin-right: auto; }
.brand:hover { text-decoration: none; }
.mark { display: inline-block; flex: none; width: 24px; height: 24px; background: currentColor; -webkit-mask: url(../assets/relay-mark-bold.svg) center / contain no-repeat; mask: url(../assets/relay-mark-bold.svg) center / contain no-repeat; }
.nav-links { display: flex; gap: 26px; font-size: 13px; letter-spacing: -.01em; }
.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); text-decoration: none; }
.theme { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; }
.theme:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.theme svg { width: 17px; height: 17px; }
.sun { display: none; }
:root[data-theme="light"] .sun { display: block; } :root[data-theme="light"] .moon { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .sun { display: block; } :root:not([data-theme="dark"]) .moon { display: none; } }

.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 99px; background: var(--btn); color: #fff; font-size: 17px; font-weight: 500; transition: background .2s; }
.pill:hover { background: var(--btn-hover); text-decoration: none; }
.pill.sm { min-height: 30px; padding: 0 14px; font-size: 13px; }
.ghost { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--text); font-size: 15px; font-weight: 500; cursor: pointer; }
.ghost:hover { background: color-mix(in srgb, var(--text) 6%, transparent); text-decoration: none; }
.copy { flex: none; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); font: 500 13px var(--sans); cursor: pointer; }
.copy:hover { border-color: var(--muted); }
.more { font-size: 17px; }
.more::after { content: " ›"; }

main { padding: 64px 0 120px; }
h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.06; font-weight: 600; letter-spacing: -.03em; margin: 0 0 14px; }
h2 { font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; margin: 0 0 12px; }
h3 { font-size: 21px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; margin: 0 0 14px; }
.lede { font-size: clamp(19px, 2vw, 21px); line-height: 1.42; color: var(--muted); max-width: 36em; margin: 0; letter-spacing: -.012em; }
.sub { color: var(--muted); margin: 0 0 8px; }
.fine { font-size: 14px; color: var(--dim); margin: 14px 0 0; letter-spacing: -.01em; }
.fine code { font-size: 13px; color: var(--muted); }
.lbl { display: block; margin: 18px 0 8px; color: var(--text); font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tags span { padding: 1px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 12px; font-weight: 600; }
.tags .relay { border-color: var(--text); color: var(--text); }
.badge { display: inline-block; padding: 1px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: -.01em; vertical-align: middle; }
h1 .badge { font-size: 13px; vertical-align: 10px; }

/* Directory: filters on the left, the list on the right; stacked on phones */
.head { margin-bottom: 48px; }
.dir { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.side { position: sticky; top: 76px; }
.side .lbl:first-child { margin-top: 0; }
.side input[type="search"] { width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--alt); color: var(--text); font-size: 15px; }
.seg { margin: 18px 0 0; padding: 0; border: 0; }
.seg legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--text); font-size: 13px; font-weight: 500; }
.seg input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.list { display: grid; gap: 12px; }
.card { display: flex; gap: 20px; padding: 20px 22px; background: var(--alt); border: 1px solid var(--line); border-radius: 16px; color: var(--text); transition: border-color .2s; }
.card:hover { border-color: var(--muted); text-decoration: none; }
.card[hidden] { display: none; }
.card-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.card-name { display: flex; align-items: center; gap: 10px; font-size: 19px; letter-spacing: -.02em; }
.card-name b { font-weight: 600; }
.card-role { color: var(--muted); font-size: 15px; letter-spacing: -.01em; }
.card .tags { margin-top: 4px; }
.card-run { flex: none; display: grid; align-content: start; justify-items: end; gap: 2px; font: 600 14px var(--mono); }
.card-run small { color: var(--dim); font: 500 12px var(--sans); }
.none { color: var(--muted); }

.stories { margin-top: 120px; max-width: 820px; }
.story { padding: 32px 0; border-top: 1px solid var(--line); }
.story:last-of-type { border-bottom: 1px solid var(--line); }
.stories > .sub { margin-bottom: 32px; }
.kicker { display: block; color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 8px; letter-spacing: -.01em; }
.steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding-left: 40px; color: var(--muted); counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; color: var(--dim); font: 600 12px var(--sans); }
.steps b { color: var(--text); font-weight: 600; }
.get { margin-top: 96px; padding: 56px 24px; border-radius: 22px; background: var(--alt); text-align: center; }
.get h2 { margin-bottom: 24px; }

/* A specialist's page */
.back { display: inline-block; margin-bottom: 28px; color: var(--muted); font-size: 14px; }
.spec .lede { margin-bottom: 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 14px; color: var(--dim); font-size: 14px; }
.runs { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 0; margin: 32px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--alt); }
.runs div { padding: 14px 18px; border-left: 1px solid var(--line); }
.runs div:first-child { border-left: 0; }
.runs dt { color: var(--dim); font-size: 12px; font-weight: 600; }
.runs dd { margin: 2px 0 0; font-size: 15px; }
.use { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); background: var(--alt); }
.tabs button { min-height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.tabs [aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.panel { padding: 4px 18px 18px; }
.panel[hidden] { display: none; }
.cmd { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--alt); }
.cmd code { flex: 1; min-width: 0; overflow-x: auto; padding: 4px 12px; font-size: 13.5px; white-space: nowrap; }
.acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.viewer { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.viewer header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); background: var(--alt); }
.viewer h2 { margin: 0; font: 500 13px var(--mono); letter-spacing: 0; overflow-wrap: anywhere; }
.viewer pre { margin: 0; max-height: 560px; overflow: auto; padding: 16px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.when, .related { margin-top: 56px; }
.when p:not(.lbl) { color: var(--muted); margin: 0; }
.related .list { margin-bottom: 18px; }

footer { background: var(--alt); color: var(--dim); font-size: 12px; letter-spacing: -.01em; padding: 22px 0 36px; }
footer .top { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin: 0 0 16px; line-height: 1.6; }
footer .row { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 0; }
footer nav a { color: var(--muted); padding: 0 10px; border-left: 1px solid var(--line); }
footer nav a:first-child { padding-left: 0; border-left: 0; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media (max-width: 760px) {
  .dir { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .side { position: static; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 20px; }
  .nav .wrap { gap: 10px; }
  .nav-links { gap: 14px; }
  .nav-links a:first-child { display: none; }
  main { padding-top: 40px; }
  .card { flex-direction: column; gap: 12px; padding: 18px; }
  .card-run { display: flex; gap: 8px; align-items: baseline; justify-items: start; }
  .runs { grid-template-columns: 1fr 1fr; }
  .runs div:last-child { grid-column: span 2; border-left: 0; border-top: 1px solid var(--line); }
  .stories { margin-top: 88px; }
  .cmd code { white-space: pre-wrap; overflow-wrap: anywhere; }
}
