/* RXXR Builder — legal page (privacy, data & security, terms).
   Tokens come from tokens.css (shared with the builder and the manual).
   Standalone: neither style.css nor manual.css is loaded here.

   Dark only, like the builder. The manual's light theme is carried by its own
   token block in manual.css; three short documents do not earn a second copy
   of it. */

* { box-sizing: border-box; }

:root {
  /* dimmer frames than the builder's — this page is read, not operated */
  --line: #1a1a1c;
  --line-hot: #3d3d42;
}

html {
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: var(--line) var(--panel);
  scroll-behavior: smooth;
}

body.legal-page {
  margin: 0;
  min-height: 100%;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.75;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ============================ header ============================ */

.legal-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--header-h);
  padding: 0 var(--sp-3);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.legal-brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.legal-brand-logo { display: block; height: 20px; width: auto; }

.legal-top-title {
  flex: 0 0 auto;
  padding-left: var(--sp-1);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  border-left: 1px solid var(--line);
}

/* dropdown.js hides the native select and puts .lang-dropdown next to it, so
   whichever one is live is the element that takes the free space here. */
.legal-top .lang-select,
.legal-top .lang-dropdown { margin-left: auto; margin-right: 0; }

.lang-select {
  align-self: center;
  height: 32px;
  padding: 0 26px 0 10px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237d7d80' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  appearance: none;
  cursor: pointer;
}
.lang-select:hover { color: var(--text); border-color: var(--line-hot); }
.lang-select:focus { outline: none; border-color: var(--accent-focus); color: var(--text); }
.lang-select option { background: var(--bg); color: var(--text); }

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  flex: 0 0 auto;
}
.legal-back:hover { color: var(--text); border-color: var(--line-hot); }
.legal-back svg { flex: 0 0 auto; display: block; }

/* ============================ page ============================ */

.legal-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px var(--sp-3) 96px;
}

.legal-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 2px;
  font-weight: 800;
  text-transform: uppercase;
}

.legal-updated {
  margin: 8px 0 0;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.legal-intro {
  margin: 20px 0 0;
  color: var(--label);
}

/* three entries — a jump row rather than the manual's sidebar */
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
}
.legal-nav-link {
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.legal-nav-link:hover { color: var(--text); border-color: var(--line-hot); }

.legal-section {
  /* the sticky header must not sit on a heading jumped to from an anchor */
  scroll-margin-top: calc(var(--header-h) + 16px);
  padding-top: 40px;
}

.legal-section-title {
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: 1.6px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
}

.legal-subhead {
  margin: 28px 0 8px;
  font-size: 11px;
  letter-spacing: 1.4px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
}

.legal-text {
  margin: 0 0 12px;
  color: var(--label);
}

.legal-list {
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--label);
}
.legal-list li { margin: 0 0 6px; }
.legal-list li::marker { color: var(--line-hot); }

.legal-foot {
  margin: 48px 0 0;
  padding-top: 20px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.legal-foot a { color: var(--accent); }

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

@media (max-width: 640px) {
  .legal-top { gap: var(--sp-1); padding: 0 var(--sp-1); }
  .legal-top-title { display: none; }
  .legal-shell { padding: 28px var(--sp-2) 64px; }
  .legal-title { font-size: 20px; }
}
