/* ═══════════════════════════════════════════════════════════════════════════
   ROUNDZ — LEGAL PAGES (terms.html · privacy.html)
   The landing's "floor of the exchange" terminal language, applied to a long
   document: one console rail, hairline dividers, mono section index, numbers
   and rules carried by type rather than by boxes.

   Shared by BOTH pages on purpose — they used to carry two identical copies of
   an inline <style> block, which is how they drifted out of the app's design in
   the first place. Tokens mirror :root in style.css; keep them in sync.

   No JS on these pages, by design (they must render if everything else fails).
   The TOC is therefore pure CSS: sticky rail on desktop, two-column index in
   the flow on phones.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --bg: #0B1220;
  --deep: #07101d;
  --surface: #111A2B;
  --accent: #00E5FF;
  --support: #A855FF;
  --text: #E6EEFF;
  --muted: #8B98B3;
  --dim: #64708c;
  --line: rgba(139, 152, 179, .18);
  --line2: rgba(139, 152, 179, .30);
  --green: #4EF6C2;
  --red: #FF5A6A;
  --gold: #ffd35d;
  --r: 16px;
  --font-head: "Sora", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --rail-w: min(1180px, calc(100vw - 48px));
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--deep); scroll-behavior: smooth; }
/* Anchor jumps must clear the 60px sticky topbar. */
html { scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.7 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: rgba(0, 229, 255, .25); }

/* Scrollbars — same treatment as style.css (these pages don't load it). The
   page itself scrolls here, and so does the sticky contents rail. */
html { scrollbar-width: thin; scrollbar-color: rgba(139, 152, 179, .32) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(139, 152, 179, .30);
  background-clip: padding-box;
  border: 3px solid transparent;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 229, 255, .45); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ── shared atoms (same names as the landing) ─────────────────────────────── */
.rail { width: var(--rail-w); margin: 0 auto; }
.mlabel {
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.mono { font-family: var(--font-mono); }

/* corner ticks — the terminal frame marks */
.ticked { position: relative; }
.ticked::before, .ticked::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid rgba(0, 229, 255, .45);
  pointer-events: none;
}
.ticked::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.ticked::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 600 13px/1 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #041019; }
.btn-primary:hover { box-shadow: 0 0 28px rgba(0, 229, 255, .38); }
.btn-ghost { color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: rgba(0, 229, 255, .55); color: var(--accent); }

/* ── topbar ───────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 18, 32, .96);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 60px;
  padding: env(safe-area-inset-top, 0px) 0 0;
}
.logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: 800 22px/1 var(--font-head);
  letter-spacing: -.03em;
  color: var(--text);
  text-decoration: none;
}
.logo b { color: var(--accent); }
.top-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
/* :not(.btn) throughout — the Play button is an <a> in this nav, and these rules
   used to win over .btn/.btn-primary on specificity, repainting it muted 11px
   (owner 2026-08-04: "кнопка play становится меньше и менее читаемой"). */
.top-nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.top-nav a:not(.btn):hover { color: var(--accent); }
.top-nav a.on { color: var(--text); }
.top-nav a.on::before {
  content: "";
  width: 5px; height: 5px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
}
/* Same Play button as the landing's topbar: solid cyan, dark ink, 13px mono. */
.top-nav .btn { margin-left: 10px; color: #041019; font: 600 13px/1 var(--font-mono); letter-spacing: .14em; }
.top-nav .btn:hover { color: #041019; }

/* ── document header ──────────────────────────────────────────────────────── */
.doc-head { padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 44px); }
.doc-head-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.doc-eyebrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.doc-eyebrow .mlabel { color: var(--accent); }
.doc-eyebrow .mlabel.dim { color: var(--muted); }
h1 {
  font: 800 clamp(32px, 5.4vw, 58px)/1.05 var(--font-head);
  letter-spacing: -.04em;
  margin-bottom: 18px;
}
.doc-lede {
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.7;
}
.doc-lede b { color: var(--text); font-weight: 600; }

/* the identity sheet — the landing's terms-sheet card, carrying doc metadata */
.sheet {
  background: rgba(17, 26, 43, .85);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.sheet-head .mlabel:first-child { color: var(--accent); }
.sheet-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.sheet-row:last-child { border-bottom: 0; }
.sheet-row .k {
  font: 500 11px/1.5 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  flex: none;
}
.sheet-row .v {
  font: 600 13px/1.5 var(--font-mono);
  letter-spacing: .02em;
  color: var(--text);
  text-align: right;
}
.sheet-row .v.hot { color: var(--accent); }
.sheet-row .v.good { color: var(--green); }
.sheet-row .v a { color: inherit; }
.sheet-row .v a:hover { color: var(--accent); }

/* ── the console: TOC rail + document body ────────────────────────────────── */
.doc {
  width: var(--rail-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.toc {
  position: sticky;
  top: 60px;
  align-self: start;
  padding: 30px 22px 40px;
  border-right: 1px solid var(--line);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.toc-title { display: block; margin-bottom: 16px; color: var(--accent); }
.toc ol { list-style: none; }
.toc li + li { margin-top: 2px; }
.toc a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
  border-top: 1px solid transparent;
}
.toc a > i {
  font: 500 11px/1.5 var(--font-mono);
  letter-spacing: .08em;
  font-style: normal;
  color: var(--dim);
}
.toc a:hover { color: var(--text); }
.toc a:hover > i { color: var(--accent); }
/* :target lights the entry you jumped to — pure CSS "you are here" */
.toc a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

article { border-left: 0; }

.sec {
  padding: clamp(34px, 4vw, 52px) clamp(20px, 3.4vw, 48px);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 72px;
}
.sec:last-child { border-bottom: 0; }
.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.sec-idx {
  font: 600 12px/1 var(--font-mono);
  letter-spacing: .1em;
  color: var(--accent);
  text-decoration: none;
}
a.sec-idx:hover { text-decoration: underline; text-underline-offset: 4px; }
.sec-rule { flex: 1; height: 1px; background: var(--line); }
/* the jumped-to section flashes its rule cyan, so a deep link lands visibly */
.sec:target .sec-rule { background: linear-gradient(90deg, rgba(0, 229, 255, .55), var(--line) 60%); }

h2 {
  font: 800 clamp(22px, 2.6vw, 30px)/1.18 var(--font-head);
  letter-spacing: -.03em;
  margin-bottom: 16px;
  max-width: 30ch;
}
h3 {
  font: 700 15px/1.4 var(--font-head);
  letter-spacing: -.01em;
  margin: 28px 0 12px;
}
p { color: #c3d0e6; max-width: 74ch; }
p + p, ul + p, p + ul, .callout + p, p + .callout, .legalese + p { margin-top: 14px; }
strong { color: var(--text); font-weight: 600; }
em { color: var(--muted); font-style: normal; }
a { color: var(--accent); text-underline-offset: 3px; }

/* Scoped to `article` on purpose — the TOC is a <ol> of the same primitives and
   must not inherit the cyan dash or the list rhythm. */
article ul { list-style: none; max-width: 74ch; }
article li { position: relative; padding-left: 20px; color: #c3d0e6; }
article li + li { margin-top: 12px; }
article li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .72em;
  width: 6px; height: 1px;
  background: var(--accent);
  opacity: .75;
}
article li strong:first-child { color: var(--text); }

/* ── callouts: the three or four lines that actually cost money ───────────── */
.callout {
  margin-top: 20px;
  padding: 16px 20px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: rgba(17, 26, 43, .6);
  max-width: 74ch;
}
.callout .mlabel { display: block; margin-bottom: 8px; color: var(--accent); }
.callout p { color: var(--text); font-size: 15px; }
.callout.warn { border-color: rgba(255, 90, 106, .38); background: rgba(255, 90, 106, .06); }
.callout.warn .mlabel { color: var(--red); }
.callout.warn::before, .callout.warn::after { border-color: rgba(255, 90, 106, .5); }

/* the all-caps warranty/liability block — set as a document, not as shouting */
.legalese {
  margin-top: 16px;
  padding: 16px 20px;
  border-left: 2px solid var(--line2);
  background: rgba(7, 16, 29, .5);
  color: var(--muted);
  font: 400 13px/1.75 var(--font-mono);
  letter-spacing: .01em;
  max-width: 74ch;
}
.legalese strong { color: var(--text); font-weight: 500; }

/* ── data table (privacy: browser storage) ────────────────────────────────── */
.table-wrap { margin-top: 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th {
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(7, 16, 29, .6);
  white-space: nowrap;
}
td { color: #c3d0e6; }
code {
  font: 500 12.5px/1.5 var(--font-mono);
  color: var(--accent);
  background: rgba(0, 229, 255, .07);
  border: 1px solid rgba(0, 229, 255, .2);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ── footer ───────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  background: var(--deep);
  padding: 36px 24px calc(40px + env(safe-area-inset-bottom, 0px));
  margin-top: 0;
}
.foot-in { max-width: 820px; margin: 0 auto; text-align: center; }
.foot-disc {
  font: 400 12.5px/1.8 var(--font-mono);
  letter-spacing: .02em;
  color: var(--muted);
  margin-bottom: 16px;
  max-width: none;
}
.foot-links {
  font: 500 12px/1.6 var(--font-mono);
  letter-spacing: .08em;
  color: var(--muted);
  max-width: none;
}
.foot-links a {
  display: inline-block;
  padding: 12px 4px;
  margin: -12px -4px;
  color: var(--muted);
  text-decoration: none;
}
.foot-links a:hover { color: var(--accent); }
.foot-links .sep { margin: 0 10px; color: var(--line2); }

/* ── laptop: the TOC rail is the first thing to go ────────────────────────── */
@media (max-width: 1080px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 24px clamp(20px, 3.4vw, 48px);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
  }
  .toc li + li { margin-top: 0; }
  .toc li:nth-child(-n+2) a { border-top: 0; }
  .toc a { border-top: 1px solid var(--line); padding: 9px 0; }
}
@media (max-width: 980px) {
  .doc-head-in { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .sheet { max-width: 460px; }
}

/* ── phone ────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --rail-w: 100%; }
  .rail { padding: 0 18px; }
  .topbar-in { padding: env(safe-area-inset-top, 0px) 18px 0; gap: 8px; }
  .logo { font-size: 20px; }
  .top-nav { gap: 0; }
  .top-nav a:not(.btn) { padding: 0 8px; font-size: 10px; letter-spacing: .12em; }
  .top-nav .btn { margin-left: 6px; padding: 0 14px; min-height: 40px; font-size: 12px; }

  .doc-head { padding: 34px 0 26px; }
  .doc-lede { font-size: 14.5px; }
  /* The metadata sheet is desktop furniture: every value on it (date, jurisdiction,
     18+, contact) is restated in the document body and the footer. */
  .sheet { display: none; }

  .doc { border-left: 0; border-right: 0; }
  .toc { padding: 20px 18px; }
  .toc ol { grid-template-columns: minmax(0, 1fr); }
  .toc li:nth-child(-n+2) a { border-top: 1px solid var(--line); }
  .toc li:first-child a { border-top: 0; }
  .toc a { grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 13.5px; }

  .sec { padding: 28px 18px; }
  h2 { max-width: none; }
  p, li, ul, .callout, .legalese { max-width: none; }
  .callout { padding: 14px 16px; }
  .legalese { padding: 14px 16px; font-size: 12.5px; line-height: 1.7; }
  footer { padding: 28px 18px calc(30px + env(safe-area-inset-bottom, 0px)); }
}

/* ── print: a legal document should survive Cmd-P ─────────────────────────── */
@media print {
  html, body { background: #fff; color: #000; }
  .topbar, .toc, .sheet, footer .foot-links, .btn { display: none !important; }
  .doc, .rail { width: auto; border: 0; }
  .doc { grid-template-columns: 1fr; }
  .sec { padding: 12pt 0; border-bottom: 1px solid #bbb; break-inside: auto; }
  .sec-head { margin-bottom: 6pt; }
  .sec-idx, .doc-eyebrow .mlabel { color: #000; }
  .sec-rule { background: #bbb; }
  h1 { font-size: 22pt; }
  h2 { font-size: 13pt; break-after: avoid; }
  p, li, td { color: #111; font-size: 10pt; line-height: 1.5; }
  a { color: #000; text-decoration: underline; }
  .callout, .legalese, .table-wrap { border-color: #999; background: none; }
  .callout p, .legalese { color: #111; }
  code { color: #000; background: none; border: 1px solid #bbb; }
}
