/* Shared styling for the standalone legal pages (/terms, /privacy).
   Tokens are copied from the landing page's inline <style> so the pages read
   as part of the same site. */

:root {
  --ink: #eef1fb;
  --ink-soft: #a7b0d0;
  --blue: #5089ff;
  --paper: #0a0d18;
  --paper-dim: #0f1424;
  --line: rgba(238, 241, 251, 0.10);
  --line-strong: rgba(238, 241, 251, 0.18);
  --shadow: 0 20px 44px -24px rgba(0, 0, 0, 0.6);
  --sans: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans);
  font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }

/* ---------- header ---------- */
header.site { border-bottom: 1px solid var(--line); background: var(--paper); }
/* Back button hard left, mark centred, language switch right — the same
   three-up arrangement the landing page's header uses. */
header.site .wrap {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 12px; height: 84px;
}
.brand { justify-self: center; display: flex; align-items: center; text-decoration: none; }
.brand img { height: 44px; width: 44px; }
.back-link {
  justify-self: start; display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; font-size: 18px; line-height: 1;
  text-decoration: none; color: var(--ink-soft);
  background: var(--paper-dim); border: 1px solid var(--line);
  transition: color .15s ease, border-color .15s ease;
}
.back-link:hover { color: var(--ink); border-color: var(--line-strong); }
.lang-switch { justify-self: end; }

/* ---------- document ---------- */
main.legal { padding: 64px 0 96px; }
.legal-head { max-width: 720px; margin: 0 auto 44px; }
.legal-head h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 600; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.legal-head p { color: var(--ink-soft); margin: 20px 0 0; text-wrap: pretty; }
.legal-head p.updated { font-size: 14px; margin-top: 14px; }
.legal-head ul { color: var(--ink-soft); margin: 16px 0 0; padding-left: 22px; }

.toc {
  max-width: 720px; margin: 0 auto 48px; background: var(--paper-dim);
  border: 1px solid var(--line); border-radius: 16px; padding: 22px 26px;
}
.toc h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 0 0 12px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 20px; color: var(--ink-soft); font-size: 13.5px; }
.toc li { margin-bottom: 8px; letter-spacing: 0.04em; }
.toc a { text-decoration: none; color: var(--ink); }
.toc a:hover { color: var(--blue); }

article.doc { max-width: 720px; margin: 0 auto; }
article.doc section { scroll-margin-top: 96px; margin-bottom: 44px; }
/* Headings come through in caps from the source text — track them out a little
   and hold them at body size so they read as headings, not shouting. */
article.doc h2 {
  font-size: 15px; font-weight: 700; letter-spacing: 0.05em; line-height: 1.4;
  margin: 0 0 16px; padding-top: 26px; border-top: 1px solid var(--line);
}
article.doc h3 { font-size: 16.5px; font-weight: 700; margin: 24px 0 8px; }
article.doc p { color: var(--ink-soft); margin: 0 0 14px; text-wrap: pretty; }
article.doc ul { color: var(--ink-soft); margin: 0 0 14px; padding-left: 22px; }
article.doc li { margin-bottom: 8px; }
article.doc strong { color: var(--ink); font-weight: 600; }

.callout {
  background: var(--paper-dim); border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 18px 22px; margin: 0 0 20px;
}
.callout p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
footer.site { padding: 40px 0; border-top: 1px solid var(--line); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.foot-copy { font-size: 13px; color: var(--ink-soft); }
.foot-links { display: flex; gap: 18px; font-size: 13.5px; }
.foot-links a { color: var(--ink-soft); text-decoration: none; }
.foot-links a:hover { color: var(--blue); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  main.legal { padding: 40px 0 64px; }
  .toc { padding: 18px 20px; }
  /* Narrower gutters so the back button, mark and switch stay on one row. */
  header.site .wrap { padding: 0 16px; height: 72px; }
  .brand img { height: 38px; width: 38px; }
}
