/* Design tokens — mirrors Signal's globals.css so the two portals read as one family. */
:root {
  --fs-navy: #192855;
  --fs-cyan: #09d0ea;

  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-sunken: #f5f7fa;
  --line: #e8ecf2;
  --line-strong: #d7dde7;
  --ink: #1c2433;
  --ink-soft: #5b6678;
  --ink-faint: #8b94a6;

  --shadow-tile: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -12px rgba(16, 24, 40, 0.12);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --scalar-bg: #ffffff;
  color-scheme: light;
}
html[data-theme="dark"] {
  --canvas: #0f1319;
  --surface: #1a212c;
  --surface-sunken: #232c39;
  --line: #2b3442;
  --line-strong: #3a4555;
  --ink: #e7eaf1;
  --ink-soft: #a7b1c0;
  --ink-faint: #828c9e;
  --shadow-tile: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --scalar-bg: #0b0f17;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}
a { color: inherit; }
code { font-family: var(--font-mono); font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--fs-cyan); outline-offset: 2px; border-radius: 4px; }
[v-cloak] { display: none; }

/* Theme-aware logo: both render, CSS shows one. */
.logo-dark { display: none; }
html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="dark"] .logo-dark { display: inline-block; }

/* Header */
.hdr {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  height: 56px; padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 20px; width: auto; }
.brand .sep { width: 1px; height: 18px; background: var(--line-strong); }
.brand .name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.hdr nav { display: flex; gap: 4px; margin-left: 8px; }
.hdr nav a {
  text-decoration: none; font-size: 13.5px; font-weight: 500; color: var(--ink-soft); white-space: nowrap;
  padding: 6px 10px; border-radius: 8px; transition: color 0.15s, background-color 0.15s;
}
.hdr nav a:hover,
.hdr nav a[aria-current="page"] { color: var(--ink); background: var(--surface-sunken); }
.grow { flex: 1; }
.themebtn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.themebtn:hover { color: var(--ink); border-color: var(--line-strong); }
.themebtn svg { width: 15px; height: 15px; }

/* Phone: the brand is already the home link, so the nav is redundant; the theme
 * button keeps its icon and aria-label but drops the word. */
@media (max-width: 640px) {
  .hdr { gap: 12px; padding: 0 16px; }
  .brand img { height: 16px; }
  .brand { gap: 10px; }
  .hdr nav { display: none; }
  .themebtn { width: 32px; padding: 0; justify-content: center; }
  .themebtn-label { display: none; }
}

/* Landing */
.wrap { max-width: 1040px; margin: 0 auto; padding: 40px 24px 56px; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
@media (max-width: 860px) { .intro { grid-template-columns: minmax(0, 1fr); } }
h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; }
.lede { margin: 12px 0 0; max-width: 58ch; font-size: 15px; color: var(--ink-soft); overflow-wrap: anywhere; }
.lede code { background: var(--surface-sunken); padding: 1px 6px; border-radius: 5px; color: var(--ink); }

.facts {
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  box-shadow: var(--shadow-tile); padding: 6px 0;
}
.facts h2 { margin: 10px 16px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fs-cyan); }
.facts dl { margin: 0; }
.fact { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.fact dt { color: var(--ink-faint); font-weight: 500; }
.fact dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.fact dd code { font-size: 12px; }
.fact dd small { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 2px; }

.section { margin-top: 44px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fs-cyan); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.api {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; border-radius: 16px; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.api:hover { border-color: var(--fs-cyan); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.5); }
.api .ico {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: color-mix(in srgb, var(--fs-cyan) 12%, transparent); color: var(--fs-cyan);
}
.api .ico svg { width: 20px; height: 20px; }
.api .body { min-width: 0; flex: 1; }
.api .title { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.api .title svg { width: 14px; height: 14px; color: var(--ink-faint); transition: transform 0.15s, color 0.15s; }
.api:hover .title svg { transform: translateX(2px); color: var(--fs-cyan); }
.api .desc { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); }
.api .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--ink-faint); }
.api .meta code { color: var(--ink-soft); font-size: 11.5px; }

.prov {
  margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline;
  font-size: 12.5px; color: var(--ink-faint);
}
.prov code { font-size: 11.5px; }

/* Reference */
.ctx {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.ctx .back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.ctx .back:hover { color: var(--ink); }
.ctx .back svg { width: 16px; height: 16px; }
.ctx .vsep { width: 1px; height: 16px; background: var(--line); }
.ctx .t { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ctx .d { font-size: 12.5px; color: var(--ink-faint); }
@media (max-width: 760px) { .ctx .d { display: none; } }
.ctx .sync { font-size: 12px; color: var(--ink-faint); }
.ctx .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.ctx .right a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); }
.ctx .right a:hover { color: var(--ink); }
.ctx .right a svg { width: 13px; height: 13px; opacity: 0.7; }
.ctx .right a.other { color: var(--fs-cyan); }

.viewer { min-height: calc(100vh - 56px - 45px); background: var(--scalar-bg); }
.viewer .scalar-app,
.viewer .scalar-api-reference { --scalar-font: var(--font-sans); --scalar-font-code: var(--font-mono); }

footer {
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center;
  max-width: 1040px; margin: 0 auto; padding: 20px 24px 36px; font-size: 12px; color: var(--ink-faint);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
