/* FreeBacktest — the shared skin for /terms and /privacy.
 *
 * External on purpose. The landing keeps its CSS inline because that page is
 * render-critical and one blocking request there costs FCP; these two pages are
 * text, read once, and two of them would otherwise carry the same 200 lines
 * twice. 'self' is allowed by the enforced CSP, and the nginx block for *.css
 * gives it a one-hour cache.
 *
 * The token block below is a COPY of the landing's. Extracting the landing's
 * tokens into this file would turn its inline critical CSS into a blocking
 * request on the one page where that matters — a worse trade than duplicating
 * a dozen colour lines. If the palette changes, both files change.
 */

:root{
  color-scheme:light;
  --paper:#f4f2ed; --alt:#efede6; --card:#ffffff; --ink:#0e0e0e; --gray:#4a4a45;
  --faint:#a09c92; --line:#0e0e0e; --line-soft:rgba(14,14,14,.15);
  --green:#1a9e8f; --red:#e0483f;
  --foot-bg:#0e0e0e; --foot-text:#b9b9b0; --foot-head:#f4f2ed; --foot-line:rgba(244,242,237,.2); --foot-dim:#8a8a80;
  --knob:#ffffff; --knob-shadow:0 1px 3px rgba(14,14,14,.3); --track:rgba(14,14,14,.1);
}
html[data-theme="dark"]{
  color-scheme:dark;
  --paper:#0e0e11; --alt:#111115; --card:#16161b; --ink:#eceef2; --gray:#a7abb6;
  --faint:#666b76; --line:#33343c; --line-soft:rgba(236,238,242,.14);
  --green:#26a69a; --red:#ef5350;
  --foot-bg:#0a0a0c; --foot-text:#9a9ea8; --foot-head:#eceef2; --foot-line:rgba(236,238,242,.16); --foot-dim:#767b86;
  --knob:#eceef2; --knob-shadow:none; --track:rgba(236,238,242,.16);
}
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{background:var(--paper);color:var(--ink);font-family:'Inter',sans-serif;line-height:1.6;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
.wrap{max-width:1200px;margin:0 auto;padding:0 28px}

/* NAV — the landing's object, minus the section anchors. */
nav{position:sticky;top:0;z-index:900;background:var(--paper);border-bottom:1px solid var(--line)}
.nav-in{display:flex;align-items:center;gap:26px;height:64px}
.logo{font-weight:900;font-size:19px;letter-spacing:-.02em;display:flex;align-items:center;gap:10px}
.logo .sq{width:12px;height:12px;background:var(--ink)}
.nav-links{display:flex;gap:24px;margin-left:auto;font-size:11.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--gray)}
.nav-links a:hover{color:var(--ink);text-decoration:underline;text-underline-offset:4px}
.nav-links a[aria-current="page"]{color:var(--ink)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;font-weight:700;cursor:pointer;transition:.18s;border:1px solid var(--ink);letter-spacing:.02em;white-space:nowrap}
.btn-ghost{padding:10px 18px;font-size:13px;background:transparent;color:var(--ink)}
.btn-ghost:hover{background:var(--ink);color:var(--paper)}
.btn-solid{padding:10px 20px;font-size:13px;background:var(--ink);color:var(--paper)}
.btn-solid:hover{background:var(--green);border-color:var(--green);color:#fff}
.nav-cta{display:flex;gap:10px;margin-left:6px}

/* THEME SWITCH — identical markup and behaviour to the landing's; landing.js
   finds it by id and wires it. JS-only control; light is the no-JS default. */
.theme-btn{display:none;position:relative;width:46px;height:26px;padding:0;border:1px solid var(--line);background:var(--track);cursor:pointer;flex:none;transition:background .18s,border-color .18s}
html.js .theme-btn{display:inline-flex}
.theme-btn .tl,.theme-btn .td{position:absolute;top:50%;margin-top:-6px;font-size:11px;line-height:12px;color:var(--ink);opacity:.5;pointer-events:none;transition:opacity .18s}
.theme-btn .tl{left:5px}
.theme-btn .td{right:5px}
.theme-btn[aria-checked="true"] .tl{opacity:.2}
.theme-btn[aria-checked="false"] .td{opacity:.2}
.theme-btn .knob{position:absolute;left:2px;top:2px;width:20px;height:20px;background:var(--knob);box-shadow:var(--knob-shadow);transform:translateX(0);transition:transform .22s cubic-bezier(.22,1,.36,1),background .22s}
.theme-btn[aria-checked="true"] .knob{transform:translateX(20px)}
.theme-btn:focus-visible{outline:2px solid var(--green);outline-offset:2px}
a:focus-visible,button:focus-visible{outline:2px solid var(--green);outline-offset:3px}

/* PAGE HEAD */
.doc-head{border-bottom:1px solid var(--line)}
.doc-head .wrap{padding-top:56px;padding-bottom:44px}
.kick{font-family:'JetBrains Mono',monospace;font-size:11px;letter-spacing:.22em;color:var(--faint);text-transform:uppercase}
h1{font-size:clamp(34px,5.4vw,68px);font-weight:900;letter-spacing:-.045em;line-height:1;text-transform:uppercase;margin:14px 0 0}
h1 .accent{color:var(--green)}
.updated{font-family:'JetBrains Mono',monospace;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--green);margin-top:20px}
.lede{color:var(--gray);max-width:680px;font-size:17px;margin-top:16px;border-top:1px solid var(--line);padding-top:18px}

/* BODY */
.doc .wrap{padding-top:8px;padding-bottom:72px}
.doc-body{max-width:760px}
.doc-body section{padding:36px 0 0}
.doc-body h2{font-family:'JetBrains Mono',monospace;font-size:12px;letter-spacing:.2em;text-transform:uppercase;font-weight:700;color:var(--ink);padding-bottom:10px;border-bottom:2px solid var(--line);margin-bottom:18px;display:flex;gap:14px;align-items:baseline}
.doc-body h2 .n{color:var(--green)}
.doc-body h3{font-size:17px;font-weight:800;letter-spacing:-.01em;margin:24px 0 8px}
.doc-body p{margin-bottom:14px;font-size:16px;color:var(--gray)}
.doc-body p strong,.doc-body li strong{color:var(--ink);font-weight:700}
.doc-body ul{list-style:none;margin:0 0 16px}
.doc-body li{position:relative;padding-left:20px;margin-bottom:9px;font-size:16px;color:var(--gray)}
.doc-body li::before{content:"\2014";position:absolute;left:0;color:var(--green);font-family:'JetBrains Mono',monospace;font-size:13px}
.doc-body a:not(.btn){color:var(--ink);text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--green)}
.doc-body a:not(.btn):hover{color:var(--green)}
.mono{font-family:'JetBrains Mono',monospace;font-size:.92em}

/* CALLOUT — the summary at the top, and the few paragraphs that must not be
   skimmed past. Same square/hard-border language as the landing's cards. */
.box{background:var(--card);border:2px solid var(--line);padding:24px 26px;margin:0 0 8px}
.box.mark{border-color:var(--green)}
.box h3{margin-top:0}
/* The callout box heading is a TOP-LEVEL section of the document, so it has to
   be an h2 — an h3 straight after the h1 skips a level, which is what the audit
   flagged on both legal pages. But it must not LOOK like a numbered section
   header, because it is not one: no rule, no mono uppercase, no counter. This
   rule undoes the .doc-body h2 chrome and restores the h3 appearance, so the
   markup is honest and the page is unchanged. */
.box h2{font-family:'Inter',system-ui,sans-serif;font-size:17px;font-weight:800;letter-spacing:-.01em;
        text-transform:none;color:var(--ink);border-bottom:0;padding-bottom:0;
        margin:0 0 8px;display:block}
.box p:last-child,.box ul:last-child{margin-bottom:0}
.box li:last-child{margin-bottom:0}

/* TABLE — the landing's compare-table treatment, left-aligned for prose. */
.table-scroll{overflow-x:auto;border:2px solid var(--line);margin:20px 0 8px;background:var(--card)}
table{width:100%;border-collapse:collapse;font-size:14px;min-width:560px}
th,td{padding:13px 16px;text-align:left;border-bottom:1px solid var(--line-soft);vertical-align:top;color:var(--gray)}
th{font-family:'JetBrains Mono',monospace;font-size:11px;letter-spacing:.12em;text-transform:uppercase;border-bottom:2px solid var(--line);color:var(--ink)}
td:first-child{color:var(--ink);font-weight:600}
tr:last-child td{border-bottom:0}

/* The pair of links that closes each document. */
.doc-foot{margin-top:44px;border-top:1px solid var(--line);padding-top:26px;display:flex;flex-wrap:wrap;gap:12px}

/* FOOTER — the landing's, unchanged. */
footer{padding:52px 0 36px;font-size:13.5px;background:var(--foot-bg);color:var(--foot-text);border-top:1px solid var(--line)}
.foot-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:32px;margin-bottom:40px}
.foot-grid h3{font-family:'JetBrains Mono',monospace;color:var(--foot-head);font-size:11px;letter-spacing:.18em;text-transform:uppercase;font-weight:700;margin-bottom:15px}
.foot-grid a{display:block;margin-bottom:9px}
.foot-grid a:hover{color:var(--foot-head)}
.foot-grid p{max-width:280px}
footer .logo{color:var(--foot-head)}
footer .logo .sq{background:var(--green)}
.disclaimer{border-top:1px solid var(--foot-line);padding-top:24px;font-family:'JetBrains Mono',monospace;font-size:10px;line-height:1.75;color:var(--foot-dim);letter-spacing:.01em}

@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
@media(max-width:920px){
  .foot-grid{grid-template-columns:1fr 1fr}
  .nav-links{display:none}
}
@media(max-width:560px){
  .wrap{padding:0 16px}
  .nav-in{gap:10px;height:56px}
  .logo{font-size:15px}
  .nav-cta{gap:8px;margin-left:auto}
  .doc-head .wrap{padding-top:36px;padding-bottom:32px}
  .doc-body p,.doc-body li{font-size:15.5px}
  .doc-body h2{font-size:11px;letter-spacing:.16em}
  .foot-grid{grid-template-columns:1fr}
}
