/* soli-sfu site. Floor-plan identity: pale drafting paper, navy ink, and one
   colour per conversation group. Group colours mean "a group" everywhere
   they appear; they are never used as decoration. */

:root {
  --paper: #eef2f5;
  --paper-2: #e3e9ee;
  --sheet: #f8fafb;
  --ink: #16243b;
  --ink-2: #44546b;
  --ink-3: #6f7e91;
  --line: #c9d3dc;
  --grid: #dbe3ea;
  --link: #1d4fc4;
  --code-bg: #16243b;
  --code-ink: #dfe7f1;
  --code-dim: #8fa2bb;
  --g1: #d9472f;   /* group one  */
  --g2: #d99a12;   /* group two  */
  --g3: #23935f;   /* group three */
  --g4: #6a4fd0;   /* group four */
  --warn: #9a5b00;
  --warn-bg: #fbf0dc;
  --note-bg: #e4ecf8;
  --code-edge: transparent;

  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "Fragment Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* type scale: 1.25 (major third) on a 17px body */
  --t-0: 0.8rem;
  --t-1: 1rem;
  --t-2: 1.25rem;
  --t-3: 1.563rem;
  --t-4: 1.953rem;
  --t-5: 2.441rem;
  --t-hero: clamp(2.6rem, 6.4vw, 5.2rem);

  --measure: 68ch;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1726;
    --paper-2: #16203a;
    --sheet: #131d30;
    --ink: #e6edf6;
    --ink-2: #b2c0d2;
    --ink-3: #8193aa;
    --line: #2b3a55;
    --grid: #1b2740;
    --link: #8eb1ff;
    --code-bg: #0a101c;
    --code-ink: #dfe7f1;
    --code-dim: #7d90aa;
    --g1: #ff7a60;
    --g2: #f2bd45;
    --g3: #4cc98c;
    --g4: #a58cff;
    --warn: #f2bd45;
    --warn-bg: #2a2214;
    --note-bg: #17264a;
    --code-edge: #24334f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1726;
  --paper-2: #16203a;
  --sheet: #131d30;
  --ink: #e6edf6;
  --ink-2: #b2c0d2;
  --ink-3: #8193aa;
  --line: #2b3a55;
  --grid: #1b2740;
  --link: #8eb1ff;
  --code-bg: #0a101c;
  --code-ink: #dfe7f1;
  --code-dim: #7d90aa;
  --g1: #ff7a60;
  --g2: #f2bd45;
  --g3: #4cc98c;
  --g4: #a58cff;
  --warn: #f2bd45;
  --warn-bg: #2a2214;
  --note-bg: #17264a;
  --code-edge: #24334f;
  color-scheme: dark;
}

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

html { font-size: 106.25%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-1);
  line-height: 1.6;
  font-feature-settings: "ss01", "tnum" 0;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

code, pre, kbd { font-family: var(--mono); font-size: 0.88em; font-variant-ligatures: none; }
:not(pre) > code {
  background: var(--paper-2);
  padding: 0.08em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--sheet); padding: 6px 10px; z-index: 10; }

/* ---------------------------------------------------------------- header */

.masthead {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px var(--gutter);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: var(--t-2);
  letter-spacing: -0.02em;
}
.wordmark svg { flex: none; }
.masthead nav { margin-left: auto; display: flex; gap: 22px; flex-wrap: wrap; }
.masthead nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* ---------------------------------------------------------------- home */

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px var(--gutter) 28px;
}
.hero h1 {
  font-size: var(--t-hero);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 800;
  margin: 0 0 28px;
  max-width: 17ch;
}
.hero .lede {
  font-size: var(--t-2);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 46ch;
  margin: 0 0 32px;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--ink);
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: transparent; color: var(--ink); }
.btn.ghost { color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

.oneliner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  max-width: 100%;
  font-family: var(--mono);
  font-size: var(--t-0);
  color: var(--ink-2);
}
.oneliner code {
  background: none;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.oneliner button { flex: none; }

/* The floor plan: the one bold element of the site. */
.plan {
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 0 var(--gutter);
}
.plan figure { margin: 0; }
.plan .scroller { overflow-x: auto; border-radius: 6px; }
.plan svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.plan figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 12px;
  color: var(--ink-3);
  font-size: var(--t-0);
}
.plan figcaption p { margin: 0; max-width: 62ch; }
.plan .legend { display: flex; gap: 16px; margin-left: auto; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.svg-wall { stroke: var(--ink); stroke-width: 3; fill: none; stroke-linecap: square; }
.svg-wall-thin { stroke: var(--ink-3); stroke-width: 1.5; fill: none; }
.svg-grid { stroke: var(--grid); stroke-width: 1; }
.svg-room { fill: var(--ink-3); font: 500 13px var(--sans); }
.svg-dim { stroke: var(--ink-3); stroke-width: 1; }
.svg-dimtext { fill: var(--ink-3); font: 12px var(--mono); }
.svg-link { stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 3 4; }
.svg-hub { fill: var(--ink); }
.svg-hubtext { fill: var(--paper); font: 700 14px var(--sans); }
.svg-hubsub { fill: var(--paper); font: 12px var(--mono); opacity: 0.8; }
.svg-person { stroke: var(--sheet); stroke-width: 2.5; }
.svg-name { fill: var(--ink-2); font: 12px var(--sans); }
.svg-circle { fill-opacity: 0.09; stroke-width: 1.5; stroke-dasharray: 5 5; }
.svg-note { fill: var(--ink); font: 600 13px var(--sans); }

.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 88px var(--gutter) 0;
}
.section > h2 {
  font-size: var(--t-4);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 12px;
  max-width: 24ch;
}
.section > .intro { color: var(--ink-2); max-width: 60ch; margin: 0 0 36px; font-size: var(--t-2); line-height: 1.5; }

.journey { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 26px 52px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--t-0);
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 2px;
  border-left: 1.5px dashed var(--line);
}
.steps h3 { margin: 0 0 4px; font-size: var(--t-2); letter-spacing: -0.015em; }
.steps p { margin: 0; color: var(--ink-2); }

.ideas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin: 0; }
.ideas div { border-top: 3px solid var(--ink); padding-top: 18px; }
.ideas dt { font-weight: 800; font-size: var(--t-3); letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 10px; }
.ideas dd { margin: 0; color: var(--ink-2); }

.compare { width: 100%; max-width: 820px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.compare th, .compare td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.compare th { font-weight: 600; color: var(--ink-3); font-size: var(--t-0); }
.compare td.n { font-weight: 700; width: 5.5em; }
.bar { display: flex; align-items: center; gap: 10px; }
.bar b { display: block; height: 10px; border-radius: 5px; background: var(--ink); flex: none; }
.bar.sfu b { background: var(--g3); }
.bar span { color: var(--ink-2); font-size: var(--t-0); white-space: nowrap; }

.limits { columns: 2; column-gap: 48px; max-width: 900px; padding-left: 1.1em; color: var(--ink-2); }
.limits li { break-inside: avoid; margin-bottom: 12px; }
.limits strong { color: var(--ink); }

.closing {
  max-width: 1200px;
  margin: 96px auto 0;
  padding: 0 var(--gutter);
}
.closing div {
  border-top: 1px solid var(--line);
  padding-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}
.closing p { margin: 0; font-size: var(--t-3); font-weight: 700; letter-spacing: -0.02em; max-width: 30ch; line-height: 1.25; }

.footer {
  max-width: 1200px;
  margin: 72px auto 0;
  padding: 24px var(--gutter) 40px;
  color: var(--ink-3);
  font-size: var(--t-0);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.footer a { color: var(--ink-2); }
.footer .spacer { flex: 1; }

/* ---------------------------------------------------------------- code */

.code {
  position: relative;
  margin: 0 0 1.5em;
}
.code pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1px solid var(--code-edge);
  padding: 18px 20px;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.55;
  font-size: 0.82rem;
  tab-size: 2;
}
.code pre .c, .code .t-com { color: var(--code-dim); font-style: italic; }
/* Syntax colours sit on the navy code panel in both themes. */
.code .t-kw   { color: #8fb4ff; }
.code .t-str  { color: #e7c784; }
.code .t-num,
.code .t-lit  { color: #f4a27c; }
.code .t-fn   { color: #74d6cb; }
.code .t-type { color: #c9a8ff; }
.code .t-key  { color: #a9d0ff; }
.code .t-var  { color: #f5a8c4; }
.code .t-flag { color: #b9c7da; }
.code .t-op   { color: #8fa2bb; }
.code[data-label]::before {
  content: attr(data-label);
  position: absolute;
  top: -1.55em;
  left: 2px;
  font-size: var(--t-0);
  color: var(--ink-3);
}
.code[data-label] { margin-top: 2.1em; }
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font: 500 0.72rem var(--sans);
  color: var(--code-dim);
  background: var(--code-bg);
  border: 1px solid #ffffff2a;
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
}
.copy:hover { color: var(--code-ink); border-color: #ffffff55; }
.oneliner .copy { position: static; color: var(--ink-3); background: transparent; border-color: var(--line); }
.oneliner .copy:hover { color: var(--ink); border-color: var(--ink-3); }

/* ---------------------------------------------------------------- docs */

.docs-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px var(--gutter) 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
}
.toc { position: sticky; top: 24px; align-self: start; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 7px 0 7px 14px;
  border-left: 2px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
}
.toc a:hover { color: var(--ink); border-left-color: var(--ink-3); }
.toc a[aria-current="page"] { color: var(--ink); border-left-color: var(--ink); font-weight: 700; }
.toc .group-label { color: var(--ink-3); font-size: var(--t-0); margin: 22px 0 6px; }
.toc .group-label:first-child { margin-top: 0; }

.doc { max-width: var(--measure); padding-bottom: 24px; }
.doc h1 {
  font-size: var(--t-5);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 8px 0 18px;
}
.doc .lede { font-size: var(--t-2); line-height: 1.5; color: var(--ink-2); margin: 0 0 36px; }
.doc h2 {
  font-size: var(--t-3);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 52px 0 12px;
  scroll-margin-top: 16px;
}
.doc h3 { font-size: var(--t-2); margin: 32px 0 8px; }
.doc p, .doc ul, .doc ol { margin: 0 0 1.1em; }
.doc li { margin-bottom: 0.4em; }
.doc li::marker { color: var(--ink-3); }

.doc table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: 0.94rem; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--ink-3); font-weight: 600; font-size: var(--t-0); }
.doc td code { white-space: nowrap; }

.verb { display: inline-block; min-width: 4.4em; font: 600 0.72rem var(--mono); color: var(--ink-3); }

.callout { border-left: 3px solid var(--link); background: var(--note-bg); padding: 14px 18px; border-radius: 0 6px 6px 0; margin: 0 0 1.5em; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.callout p:last-child { margin-bottom: 0; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { text-decoration: none; display: flex; flex-direction: column; color: var(--ink); font-weight: 700; }
.pager a small { color: var(--ink-3); font-weight: 400; font-size: var(--t-0); }
.pager a.next { text-align: right; margin-left: auto; }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 900px) {
  .journey { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .ideas { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .limits { columns: 1; }
  .docs-shell { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .toc { position: static; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .toc a { border-left: 0; padding: 4px 0; }
  .toc a[aria-current="page"] { text-decoration: underline; }
  .toc .group-label { display: none; }
  .plan .legend { margin-left: 0; }
  .plan svg { min-width: 720px; }
}
@media (max-width: 560px) {
  html { font-size: 100%; }
  .hero { padding-top: 32px; }
  .masthead { flex-wrap: wrap; gap: 10px 20px; }
  .masthead nav { margin-left: 0; gap: 16px; }
  .section { padding-top: 64px; }
  .compare td:last-child { display: none; }
}

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