/* Romzo website — design system
   Light reading surface, dark code, one accent. No frameworks. */

:root {
  --bg0: #faf9f6;
  --bg1: #ffffff;
  --bg2: #f0eee8;
  --line: #dedbd3;
  --ink: #222522;
  --muted: #565c56;
  --faint: #687068;
  --accent: #bd421c;
  --accent-soft: #a93817;
  --ok: #22754c;
  --warn: #916300;
  --bad: #b53b35;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --header-height: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1 0 auto; }

footer { flex-shrink: 0; }

::selection { background: rgba(189, 66, 28, 0.22); }

a { color: var(--accent-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

.wrap { width: 100%; min-width: 0; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */

nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 246, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.wordmark:hover { text-decoration: none; }
.wordmark img {
  display: block;
  width: 28px;
  height: 28px;
  flex: none;
}

.nav-links { display: flex; align-items: center; gap: 12px; }
.nav-links a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--muted); border: 1px solid transparent; border-radius: 6px; }
.nav-links svg, .lang > button svg { display: block; width: 20px; height: 20px; flex: none; }
.nav-links a[aria-label="npm"] svg { width: 18px; height: 18px; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a:hover { border-color: var(--line); }

.nav-spacer { flex: 1; }

/* language dropdown */

.lang { position: relative; flex: none; }
.lang > button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
}
.lang > button:hover { color: var(--ink); border-color: var(--line); }

.lang-menu {
  position: absolute;
  z-index: 1;
  right: 0;
  top: calc(100% + 6px);
  display: none;
  min-width: 148px;
  padding: 4px;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(34, 37, 34, 0.12);
}
.lang.open .lang-menu { display: block; }

.lang-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  background: none;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  padding: 7px 10px;
  cursor: pointer;
  text-align: left;
}
.lang-menu button:hover { background: var(--bg2); color: var(--ink); }
.lang-menu button.on { color: var(--accent-soft); }
.lang-menu button.on::after { content: "✓"; font-size: 14px; }

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

.hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 72px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 48px;
}

.hero h1 {
  font-family: var(--sans);
  font-size: clamp(3.2rem, 6.5vw, 4.6rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.045em;
  margin: 0 0 22px;
}

.hero .sub {
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 30px;
  font-size: 18px;
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
  display: inline-block;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-soft); }
.btn.ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--bg1);
}
.btn.ghost:hover { border-color: var(--faint); }
.btn:disabled { opacity: .5; cursor: default; }

/* Playground composes the shared page head, node and code panels. */
.play-layout { display: grid; grid-template-columns: minmax(340px, .85fr) minmax(0, 1.35fr); gap: 24px; align-items: start; padding-top: 40px; padding-bottom: 56px; }
.play-page .page-head .wrap { padding-top: 36px; padding-bottom: 32px; gap: 24px; }
.play-page .page-head h1 { font-size: clamp(30px, 4vw, 44px); }
.play-invite-details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.play-node { width: 360px; max-width: 100%; }
.play-page .page-head .wrap > * { min-width: 0; }
.play-doc-link { display: inline-block; margin-top: 8px; font-size: 14px; }
.play-room h2, .play-chat h2 { font: inherit; font-weight: 600; margin: 0; color: var(--ink); }
.play-step { font: 12px var(--mono); color: var(--accent); margin-right: 8px; }
.play-chat .play-step { color: var(--faint); }
.play-body { padding: 20px; }
.play-room-modes { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); margin-bottom: 20px; }
.play-room-modes[hidden] { display: none; }
.play-room-modes button { flex: 1; border: 1px solid transparent; border-radius: 5px; padding: 9px 12px; color: var(--muted); background: transparent; font: 600 14px var(--sans); cursor: pointer; }
.play-room-modes button[aria-pressed="true"] { color: var(--ink); border-color: var(--line); background: var(--bg1); }
.play-room-modes button:disabled { cursor: default; }
.play-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
#join-code { background: var(--bg1); font-family: var(--mono); }
.play-join-input { position: relative; }
.play-join-input #join-code { padding-right: 52px; }
.play-scan-trigger { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.play-scan-trigger:hover { background: var(--bg2); color: var(--accent); }
.play-scan-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.play-scan-trigger:disabled { opacity: .45; cursor: default; }
#join-hint { margin-top: 12px; }
.play-form-error { color: var(--bad); font-size: 14px; margin-bottom: 0; }
#copy-code { margin-bottom: 8px; }
.play-hint { font-size: 14px; line-height: 1.7; color: var(--muted); margin: 0 0 16px; }
#ts-widget { margin: 4px 0 12px; }
#ts-widget:not([hidden]) { background: var(--bg1); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 0; }
#create-result { margin: 0; }
.play-room-code { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.play-room-code strong { font: 600 16px var(--mono); color: var(--ink); }
.play-page .play-room-code { display: block; text-align: center; margin-bottom: 16px; }
.play-page .play-room-code strong { display: block; font-size: 23px; letter-spacing: .055em; margin-top: 4px; }
.play-qr { margin: 0 0 20px; text-align: center; }
.play-qr img { display: block; margin: 0 auto; width: 184px; height: 184px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.play-qr figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; }
.play-invite-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.play-invite-actions .btn { font-size: 14px; padding: 11px 10px; }
.play-invite-actions #copy-code { margin: 0; }
.play-feedback { min-height: 20px; margin: 8px 0; text-align: center; font-size: 12px; color: var(--ok); }
.play-feedback[data-state="error"] { color: var(--bad); }
.play-invite-details .invite-box { margin-top: 10px; margin-bottom: 0; }
.play-leave { display: block; margin: 20px auto 0; background: transparent; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.play-file-button { cursor: pointer; }
.play-file-button:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.play-empty small { display: block; font-size: 12px; margin-top: 8px; color: var(--faint); }
.play-empty-mark { display: block; width: 56px; height: 48px; margin: 0 auto 16px; border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; font: 30px/40px var(--mono); color: var(--muted); }
.play-scan-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: var(--bg1); color: var(--ink); }
.play-scan-dialog::backdrop { background: rgba(20, 25, 20, .6); }
.play-scan-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.play-scan-head h2 { font-size: 18px; margin: 0; }
.play-scan-close { border: 0; padding: 4px 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 24px; }
#scan-video { width: 100%; min-height: 180px; aspect-ratio: 4/3; object-fit: cover; background: var(--bg2); border-radius: 8px; margin-bottom: 12px; }
.invite-box { overflow-wrap: anywhere; font: 13px/1.7 var(--mono); color: var(--ink); background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin: 0 0 16px; }
.play-log { height: 380px; overflow: auto; padding: 20px; font: 15px/1.7 var(--sans); scrollbar-width: thin; }
.play-paths { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.play-paths[hidden] { display: none; }
.play-paths li { display: inline-flex; align-items: center; gap: 10px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 12px; }
.play-path { font-weight: 600; }
.play-path[data-path="rtc"] { color: var(--ok); }
.play-path[data-path="connecting"] { color: var(--muted); }
.play-log p { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.play-system { text-align: center; color: var(--faint); font-size: 12px; margin: 8px 0 16px; overflow-wrap: anywhere; }
.play-message { max-width: 85%; width: fit-content; margin: 0 0 16px; }
.play-message.is-mine { margin-left: auto; }
.play-message-meta { display: flex; gap: 12px; justify-content: space-between; color: var(--faint); font-size: 11px; margin-bottom: 5px; }
.play-message.is-mine .play-message-meta { color: var(--ok); }
.play-log .play-message-body { padding: 10px 14px; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: #2b332b; }
.play-message.is-mine .play-message-body { background: #344534; border-color: #496349; }
.play-presence { display: inline-flex; align-items: center; gap: 7px; font: 12px var(--sans); color: var(--faint); }
.play-presence::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.play-presence[data-state="online"] { color: var(--ok); }
.play-presence[data-state="online"]::before { background: var(--ok); }
.play-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--faint); text-align: center; font: 14px/1.7 var(--sans); padding: 16px; }
.play-compose { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }
.play-input { flex: 1; min-width: 0; width: 100%; background: var(--bg1); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 16px var(--sans); }
.play-input:focus-visible { outline: 2px solid var(--faint); outline-offset: 2px; }
.play-input:disabled { opacity: .5; }
.play-compose textarea { resize: vertical; max-height: 120px; min-height: 44px; line-height: 1.5; }
.play-page summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.play-compose .btn { flex: none; }
.play-status { padding: 0 20px 16px; color: var(--faint); font-size: 13px; }
.play-status p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 800px) {
  .play-layout { grid-template-columns: minmax(0, 1fr); padding-top: 28px; padding-bottom: 40px; }
}
@media (max-width: 960px) {
  .play-page .page-head .wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .play-body { padding: 16px; }
  .play-log { height: 240px; padding: 16px; }
  .play-paths { padding: 12px 16px; }
  .play-compose { padding: 16px; }
  .play-compose .btn { padding-left: 14px; padding-right: 14px; }
  .play-status { padding-left: 16px; padding-right: 16px; }
}

/* ---------- background relay mesh ---------- */

#bg-net {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero, .page-head, main, footer { position: relative; z-index: 1; }

/* ---------- install card (sdk page head) ---------- */

.page-head .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: center;
}

.install-card { width: 320px; }

/* ---------- relay node panel ---------- */

.node {
  border: 1px solid var(--line);
  background: var(--bg1);
  border-radius: 12px;
  overflow: hidden;
}

.node-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }

.node-head .grow { flex: 1; }

.ping {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}
.ping:hover { color: var(--ink); }
.ping.ok { color: var(--ok); }
.ping.warn { color: var(--warn); }
.ping.bad { color: var(--bad); }
.ping.measuring { color: var(--faint); cursor: default; }

.node-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}
.node-row:hover { background: var(--bg2); }
.node-row:last-of-type { border-bottom: 0; }

.node-addr {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.node-addr code {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--ink);
  overflow-x: auto;
  white-space: nowrap;
}

.proto {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  padding: 5px 10px;
  cursor: pointer;
}
.copy-btn:hover { color: var(--ink); border-color: var(--faint); }
.copy-btn.done { color: var(--ok); border-color: var(--ok); }

.node-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--faint);
}

/* ---------- sections ---------- */

main { counter-reset: sec; }

.section { padding: 56px 0; scroll-margin-top: 132px; counter-increment: sec; }
.section + .section { border-top: 1px solid var(--line); }

.section h2 {
  font-family: var(--sans);
  font-size: clamp(1.5rem, 2.7vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 16px;
}

.section h2::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.section p { color: var(--muted); margin: 0 0 14px; max-width: 62ch; }
.section p:last-child { margin-bottom: 0; }

/* split layout: text | code */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 48px;
  align-items: start;
}

.split > * { min-width: 0; }

.split-copy { position: sticky; top: 90px; }

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

.code-panel {
  min-width: 0;
  max-width: 100%;
  --ink: #eeeef0;
  --muted: #b9c0bb;
  --faint: #a6afa8;
  --line: #394139;
  --bg1: #202620;
  --ok: #8cd3a8;
  color: var(--ink);
  color-scheme: dark;
  border: 1px solid var(--line);
  background: var(--bg1);
  border-radius: 12px;
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.code-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.code-head .grow { flex: 1; }

.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  padding: 4px 9px;
  cursor: pointer;
}
.code-copy:hover { color: var(--ink); border-color: var(--faint); }
.code-copy.done { color: var(--ok); border-color: var(--ok); }

pre {
  position: relative;
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  tab-size: 2;
}

pre code { font-family: inherit; color: var(--ink); }

.tok-c { color: #a0aaa2; font-style: italic; }
.tok-s { color: #fbbf24; }
.tok-k { color: #93c5fd; }
.tok-n { color: #fb923c; }

p code, li code, td code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ---------- lists ---------- */

ul.plain { list-style: none; padding: 0; margin: 0 0 16px; color: var(--muted); }
ul.plain li { padding: 10px 0 10px 22px; position: relative; border-top: 1px dashed var(--line); font-size: 16px; }
ul.plain li:first-child { border-top: 0; }
ul.plain li::before { content: "›"; position: absolute; left: 0; color: var(--accent); }
ul.plain li strong { color: var(--ink); font-weight: 600; }

/* ---------- table ---------- */

table.api {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  margin: 20px 0 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

table.api th, table.api td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

table.api tr:last-child td { border-bottom: 0; }

table.api th {
  background: var(--bg1);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
}

table.api td { color: var(--muted); }
table.api td:first-child { font-family: var(--mono); font-size: 14px; color: var(--ink); white-space: nowrap; }
table.api tbody tr { transition: background 0.12s; }
table.api tbody tr:hover { background: var(--bg1); }

/* ---------- sdk page head ---------- */

.page-head {
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.page-head .wrap {
  position: relative;
  z-index: 1;
  padding-top: 64px;
  padding-bottom: 48px;
}

.page-head h1 {
  font-family: var(--sans);
  font-size: clamp(2.1rem, 4.6vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}

.page-head p { color: var(--muted); margin: 0 0 10px; max-width: 60ch; }

/* ---------- legal page (terms) ---------- */

main.legal-page { max-width: 780px; padding-top: 64px; padding-bottom: 72px; }

.legal-page h1 {
  font-family: var(--sans);
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.legal-meta {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  margin: 0 0 18px;
}

.legal-page section { margin-bottom: 36px; }

.legal-page h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.legal-page section:first-of-type h2 { border-top: 0; padding-top: 0; }

.legal-page p { color: var(--muted); font-size: 14.5px; margin: 0 0 10px; }

.legal-page ul { list-style: none; margin: 0 0 10px; padding: 0; }
.legal-page li {
  position: relative;
  padding: 8px 0 8px 22px;
  color: var(--muted);
  font-size: 14.5px;
  border-top: 1px dashed var(--line);
}
.legal-page li:first-child { border-top: 0; }
.legal-page li::before { content: "›"; position: absolute; left: 0; color: var(--accent); }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--faint);
}

.foot-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 32px;
}

.foot-brand { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; color: var(--muted); }
.foot-brand .wordmark { font-size: 18px; }
.foot-license { color: var(--muted); }

.foot-links { list-style: none; margin: 0; padding: 0; display: flex; justify-content: flex-end; align-items: baseline; flex-wrap: wrap; gap: 12px 24px; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--ink); text-decoration: none; }

/* ---------- language blocks ---------- */

html[data-lang="en"] .l-zh { display: none !important; }
html[data-lang="zh"] .l-en { display: none !important; }

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

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 56px; }
  .page-head .wrap { grid-template-columns: 1fr; gap: 24px; }
  .install-card { width: 100%; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .split-copy { position: static; }
  .foot-grid { grid-template-columns: 1fr; gap: 20px; }
  .foot-links { justify-content: flex-start; }
}

/* Technical navigation and reading details. */

.node { box-shadow: 0 4px 16px rgba(34, 37, 34, .04); }
.code-head { min-height: 44px; }
pre { scrollbar-width: thin; scrollbar-color: #626e63 #202620; }
pre:focus-visible { outline: 2px solid #fb923c; outline-offset: -3px; }
.page-head h1 { overflow-wrap: anywhere; }
.doc-toc { position: sticky; top: var(--header-height); z-index: 40; border-bottom: 1px solid var(--line); background: var(--bg0); }
.doc-toc .wrap { display: flex; gap: 24px; overflow-x: auto; padding-top: 14px; padding-bottom: 14px; scrollbar-width: thin; }
.doc-toc a { flex: none; white-space: nowrap; color: var(--muted); font-size: 14px; }
.doc-toc a:hover { color: var(--accent); }
.doc-toc + main .section { scroll-margin-top: calc(var(--header-height) + 80px); }
.doc-toc + main .split-copy { top: calc(var(--header-height) + 80px); }
table.api td { overflow-wrap: anywhere; }
table.api th:first-child, table.api td:first-child { width: 22%; }
@media (max-width: 640px) {
  :root { --header-height: 64px; }
  .wrap, .nav-inner { padding-left: 20px; padding-right: 20px; }
  .nav-inner { gap: 8px; height: 64px; padding-left: 16px; padding-right: 16px; }
  .nav-links { gap: 8px; }
  .wordmark { font-size: 18px; }
  .hero-grid { gap: 32px; padding-top: 40px; padding-bottom: 36px; }
  .hero h1 { font-size: 3rem; }
  .hero .sub { font-size: 16px; }
  .section { padding: 40px 0; scroll-margin-top: 190px; }
  .page-head .wrap { padding-top: 40px; padding-bottom: 32px; }
  .doc-toc .wrap { gap: 8px 18px; }
  .node-row { gap: 8px; padding: 12px; }
  .node-addr { gap: 8px; }
  .node-addr code { font-size: 13px; }
  .node-head { padding: 11px 12px; font-size: 14px; flex-wrap: wrap; }
  .copy-btn { padding: 6px; font-size: 14px; }
  .copy-btn svg { display: none; }
  pre { font-size: 13px; padding: 16px; }
  table.api th, table.api td { padding: 12px 8px; }
  table.api td:first-child { font-size: 14px; white-space: normal; }
  p code, li code, td code { overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  .wordmark { font-size: 16px; gap: 6px; }
  .wordmark img { width: 24px; height: 24px; }
}

/* Public test service terms. */
.legal-page { max-width: 840px; padding-top: 48px; padding-bottom: 48px; }
.legal-page h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.35; margin: 0 0 12px; }
.legal-page h2 { font-size: 22px; line-height: 1.4; margin: 0 0 12px; }
.legal-page section { margin-top: 32px; scroll-margin-top: 90px; }
.legal-page p { color: var(--muted); margin: 0 0 12px; }
.legal-page ul { padding-left: 22px; color: var(--muted); }
.legal-page li { margin-bottom: 10px; }
.legal-page .legal-meta { font-size: 14px; }
.legal-sources a { overflow-wrap: anywhere; }

.node-foot a { color: var(--muted); white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.node-foot a:hover { color: var(--ink); }

/* Homepage examples and references share one reading column. */
.home-content { max-width: 840px; }
.home-content .section > .wrap { max-width: none; padding: 0; }
.home-content .split { display: block; }
.home-content .split-copy { position: static; margin-bottom: 24px; }
.home-content .section p { max-width: none; }
.home-content .section + .section { border-top: 0; padding-top: 0; }
