/* ═══════════════════════════════════════════════════════════
   OrderFlow Trader Lab — shared styles for legal pages
   (privacy-policy.html, terms-of-service.html)
   Tokens mirror index.html so the pages stay visually identical.
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing:border-box;margin:0;padding:0; }

:root {
  --orange:#F97316; --orange-bright:#FB923C; --orange-dim:#EA580C;
  --orange-glow:rgba(249,115,22,0.15); --orange-glow-strong:rgba(249,115,22,0.28);
  --bg:#09090B; --bg-card:#0F1011; --border:rgba(255,255,255,0.08);
  --border-strong:rgba(255,255,255,0.14); --border-orange:rgba(249,115,22,0.4);
  --text-primary:#FAFAFA; --text-secondary:#A1A1AA; --text-muted:#71717A; --text-dim:#3F3F46;
  --radius-sm:8px; --radius-md:12px; --radius-lg:16px;
  --container:clamp(1rem, 5vw, 2.5rem);
}

html { overflow-x:hidden;scroll-behavior:smooth; }
html,body { background:var(--bg);color:var(--text-primary);font-family:'Inter',sans-serif;font-size:16px;line-height:1.6;-webkit-font-smoothing:antialiased;min-height:100vh; }
body { position:relative; }
body::after {
  content:'';position:absolute;top:0;left:0;right:0;height:900px;
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%,rgba(249,115,22,.16) 0%,rgba(249,115,22,.06) 35%,transparent 70%),
    linear-gradient(180deg,#060507 0%,#060507 78%,rgba(6,5,7,.4) 92%,transparent 100%);
  pointer-events:none;z-index:0;
}

/* ─── NAV ─── */
body > nav { position:sticky;top:0;z-index:100;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:0 var(--container);height:64px;border-bottom:1px solid rgba(255,255,255,.08);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);background:rgba(9,9,11,0.6); }
.nav-logo { display:flex;align-items:center;gap:9px;font-size:15px;font-weight:700;letter-spacing:-0.03em;color:var(--text-primary);text-decoration:none;white-space:nowrap;line-height:1; }
.logo-icon { width:32px;height:32px;flex-shrink:0;display:block; }
.nav-links { display:flex;gap:2rem;list-style:none;justify-content:center; }
.nav-links a { font-size:14px;font-weight:500;color:var(--text-secondary);text-decoration:none;transition:color .18s; }
.nav-links a:hover { color:var(--text-primary); }
.nav-actions { display:flex;align-items:center;gap:8px;justify-content:flex-end; }

.btn-ghost { background:transparent;border:1px solid var(--border-strong);color:var(--text-secondary);font-family:'Inter',sans-serif;font-size:14px;font-weight:500;padding:8px 16px;border-radius:var(--radius-sm);cursor:pointer;transition:all .18s;white-space:nowrap; }
.btn-ghost:hover { border-color:rgba(255,255,255,.25);color:var(--text-primary);background:rgba(255,255,255,.04); }
.btn-orange { background:var(--orange);border:none;color:#fff;font-family:'Inter',sans-serif;font-size:14px;font-weight:600;padding:8px 16px;border-radius:var(--radius-sm);cursor:pointer;transition:all .18s;white-space:nowrap; }
.btn-orange:hover { background:var(--orange-bright);box-shadow:0 0 20px var(--orange-glow-strong); }

.nav-hamburger { display:none;flex-direction:column;justify-content:center;align-items:center;gap:5px;width:40px;height:40px;background:transparent;border:1px solid var(--border-strong);border-radius:var(--radius-sm);cursor:pointer;padding:0;flex-shrink:0; }
.nav-hamburger span { display:block;width:18px;height:1.5px;background:var(--text-secondary);border-radius:2px;transition:all .3s; }
.nav-hamburger.open span:nth-child(1) { transform:translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity:0;transform:scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform:translateY(-6.5px) rotate(-45deg); }

.nav-drawer {
  position:fixed;top:72px;right:16px;left:auto;bottom:auto;width:240px;
  background:rgba(18,18,20,0.96);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);
  border:1px solid rgba(255,255,255,.1);border-radius:16px;z-index:99;padding:10px;
  flex-direction:column;gap:2px;
  box-shadow:0 20px 60px rgba(0,0,0,.6),0 0 0 1px rgba(255,255,255,.04);
  display:flex;opacity:0;pointer-events:none;transform:scale(0.95) translateY(-8px);transform-origin:top right;
  transition:opacity .22s cubic-bezier(0.16,1,0.3,1),transform .22s cubic-bezier(0.16,1,0.3,1);
}
.nav-drawer.open { opacity:1;pointer-events:all;transform:scale(1) translateY(0); }
.nav-drawer a { font-size:16px;font-weight:500;letter-spacing:-0.01em;color:var(--text-secondary);text-decoration:none;padding:12px 14px;border-radius:10px;border:none;transition:color .15s,background .15s;display:flex;align-items:center; }
.nav-drawer a:hover { color:var(--text-primary);background:rgba(255,255,255,.06); }
.nav-drawer-divider { height:1px;background:rgba(255,255,255,.07);margin:6px 0; }
.nav-drawer-actions { display:flex;flex-direction:column;gap:8px;padding:4px 0 2px; }
.nav-drawer-actions .btn-orange { width:100%;text-align:center;justify-content:center;padding:11px 14px;font-size:14px;border-radius:10px;box-shadow:0 0 20px rgba(249,115,22,.2); }

/* ─── LEGAL PAGE ─── */
.legal-hero { position:relative;z-index:2;max-width:820px;margin:0 auto;padding:clamp(56px,9vw,96px) var(--container) clamp(28px,4vw,40px);text-align:center; }
.legal-eyebrow { display:inline-block;font-family:'DM Mono',monospace;font-size:11px;font-weight:500;letter-spacing:.16em;text-transform:uppercase;color:var(--orange);background:rgba(249,115,22,.10);border:1px solid rgba(249,115,22,.22);padding:6px 14px;border-radius:100px;margin-bottom:22px; }
.legal-hero h1 { font-size:clamp(32px,6vw,48px);font-weight:600;letter-spacing:-0.04em;line-height:1.1;color:var(--text-primary); }
.legal-updated { margin-top:18px;font-family:'DM Mono',monospace;font-size:12px;letter-spacing:.06em;color:var(--text-muted); }

.legal-divider { position:relative;z-index:2;max-width:820px;margin:0 auto;padding:0 var(--container); }
.legal-divider span { display:block;height:1px;background:linear-gradient(90deg,transparent,rgba(249,115,22,.45),transparent); }

.legal-body { position:relative;z-index:2;max-width:820px;margin:0 auto;padding:clamp(36px,5vw,56px) var(--container) clamp(48px,7vw,72px); }

.legal-note { background:var(--bg-card);border:1px solid var(--border);border-left:2px solid var(--orange);border-radius:var(--radius-md);padding:20px 22px;margin-bottom:clamp(32px,5vw,48px); }
.legal-note p { font-size:14px;line-height:1.75;color:var(--text-secondary);margin:0; }
.legal-note strong { color:var(--text-primary);font-weight:600; }

.legal-toc { background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);padding:24px 26px;margin-bottom:clamp(36px,5vw,52px); }
.legal-toc h2 { font-family:'DM Mono',monospace;font-size:11px;font-weight:500;letter-spacing:.14em;text-transform:uppercase;color:var(--text-muted);margin-bottom:16px; }
.legal-toc ol { list-style:none;counter-reset:toc;display:grid;grid-template-columns:1fr 1fr;gap:10px 28px; }
.legal-toc li { counter-increment:toc;display:flex;gap:10px;align-items:baseline; }
.legal-toc li::before { content:counter(toc,decimal-leading-zero);font-family:'DM Mono',monospace;font-size:11px;color:var(--text-dim);flex-shrink:0; }
.legal-toc a { font-size:14px;color:var(--text-secondary);text-decoration:none;transition:color .18s; }
.legal-toc a:hover { color:var(--orange); }

.legal-section { scroll-margin-top:88px;margin-bottom:clamp(32px,5vw,44px); }
.legal-section:last-of-type { margin-bottom:0; }
.legal-section h2 { display:flex;align-items:baseline;gap:12px;font-size:clamp(19px,2.6vw,23px);font-weight:600;letter-spacing:-0.03em;color:var(--text-primary);margin-bottom:16px; }
.legal-section h2 .num { font-family:'DM Mono',monospace;font-size:12px;font-weight:500;color:var(--orange);flex-shrink:0;transform:translateY(-2px); }
.legal-section h3 { font-size:15px;font-weight:600;color:var(--text-primary);margin:22px 0 10px; }
.legal-section p { font-size:15px;line-height:1.8;color:var(--text-secondary);margin-bottom:14px; }
.legal-section p:last-child { margin-bottom:0; }
.legal-section ul { list-style:none;margin:0 0 16px; }
.legal-section li { position:relative;font-size:15px;line-height:1.8;color:var(--text-secondary);padding-left:20px;margin-bottom:9px; }
.legal-section li::before { content:'';position:absolute;left:4px;top:12px;width:5px;height:5px;border-radius:50%;background:var(--orange);opacity:.65; }
.legal-section li strong { color:var(--text-primary);font-weight:600; }
.legal-section a { color:var(--orange);text-decoration:underline;text-underline-offset:2px; }
.legal-section a:hover { color:var(--orange-bright); }
.legal-section table { width:100%;border-collapse:collapse;margin:6px 0 18px;font-size:14px; }
.legal-section th, .legal-section td { text-align:left;vertical-align:top;padding:11px 14px;border-bottom:1px solid var(--border); }
.legal-section th { font-family:'DM Mono',monospace;font-size:11px;font-weight:500;letter-spacing:.1em;text-transform:uppercase;color:var(--text-muted); }
.legal-section td { color:var(--text-secondary);line-height:1.7; }
.legal-section tr:last-child td { border-bottom:none; }

.legal-contact { margin-top:clamp(40px,6vw,56px);background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);padding:26px 28px; }
.legal-contact h2 { font-size:18px;font-weight:600;letter-spacing:-0.02em;margin-bottom:10px; }
.legal-contact p { font-size:14px;line-height:1.75;color:var(--text-secondary);margin-bottom:16px; }
.legal-contact a.btn-orange { display:inline-block;text-decoration:none;padding:10px 20px; }

/* ─── FOOTER ─── */
.site-footer { position:relative;z-index:2;border-top:1px solid var(--border);margin-top:clamp(48px,7vw,80px); }
.footer-inner { max-width:1200px;margin:0 auto;padding:clamp(48px,7vw,72px) var(--container) 0; }
.footer-top { display:grid;grid-template-columns:minmax(0,1.6fr) repeat(2,minmax(0,1fr));gap:clamp(32px,5vw,64px);align-items:start; }
.footer-brand { display:flex;align-items:center;gap:10px;font-size:17px;font-weight:700;letter-spacing:-0.03em;color:var(--text-primary);text-decoration:none; }
.footer-brand svg { width:30px;height:30px;flex-shrink:0; }
.footer-blurb { margin-top:16px;max-width:34ch;font-size:14px;line-height:1.75;color:var(--text-secondary); }
.footer-col h5 { font-family:'DM Mono',monospace;font-size:11px;font-weight:500;letter-spacing:.14em;text-transform:uppercase;color:var(--text-muted);margin-bottom:18px; }
.footer-col ul { list-style:none;display:flex;flex-direction:column;gap:12px; }
.footer-col a { font-size:14px;color:var(--text-secondary);text-decoration:none;transition:color .18s; }
.footer-col a:hover { color:var(--orange); }
.footer-legal { margin-top:clamp(40px,6vw,64px);padding-top:clamp(24px,4vw,32px);border-top:1px solid var(--border); }
.footer-legal p { font-size:11px;line-height:1.75;color:var(--text-dim);margin-bottom:14px; }
.footer-legal p:last-child { margin-bottom:0; }
.footer-legal strong { color:var(--text-muted);font-weight:600; }
.footer-legal a { color:var(--text-muted);text-decoration:underline;text-underline-offset:2px; }
.footer-legal a:hover { color:var(--orange); }
.footer-bottom { display:flex;align-items:center;justify-content:space-between;gap:24px;flex-wrap:wrap;margin-top:clamp(24px,4vw,32px);padding:clamp(20px,3vw,26px) 0 clamp(28px,4vw,36px);border-top:1px solid var(--border); }
.footer-copy { font-size:13px;color:var(--text-muted); }
.footer-social { display:flex;align-items:center;gap:6px; }
.footer-social a { display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:var(--radius-sm);color:var(--text-muted);transition:color .18s,background .18s; }
.footer-social a:hover { color:var(--orange);background:rgba(249,115,22,.10); }
.footer-social svg { width:16px;height:16px;display:block; }

/* ─── RESPONSIVE ─── */
@media (max-width:860px) {
  nav { grid-template-columns:auto 1fr auto; }
  .nav-links { display:none; }
  .nav-hamburger { display:flex; }
  .btn-ghost { display:none; }
}
@media (max-width:600px) {
  nav { grid-template-columns:auto 1fr auto;padding:0 1.1rem; }
  .nav-logo span, .nav-logo { font-size:13px; }
  .logo-icon { width:28px;height:28px; }
  .legal-toc ol { grid-template-columns:1fr; }
  .legal-section table, .legal-section thead, .legal-section tbody, .legal-section tr, .legal-section th, .legal-section td { display:block;width:100%; }
  .legal-section thead { display:none; }
  .legal-section tr { border-bottom:1px solid var(--border);padding:12px 0; }
  .legal-section tr:last-child { border-bottom:none; }
  .legal-section td { border-bottom:none;padding:3px 0; }
  .legal-section td::before { content:attr(data-label);display:block;font-family:'DM Mono',monospace;font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--text-muted);margin-bottom:3px; }
  .footer-top { grid-template-columns:1fr;gap:36px; }
  .footer-blurb { max-width:none; }
  .footer-bottom { flex-direction:column;align-items:flex-start;gap:18px; }
  .footer-copy { font-size:12px; }
}
