/* ============================================================
   HgBest API — legal pages (privacy.html, terms.html)
   Same design system as css/style.css. Presentation only.
   ============================================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations'),
       url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
}
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

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

:root {
  color-scheme: dark;
  --bg:      #080d17;
  --bg-2:    #0d1524;
  --surface: #0d1524;
  --border:  rgba(148,170,205,.14);
  --border-bright: rgba(148,170,205,.24);
  --cyan:    #38bdf8;
  --cyan-soft: #7dd3fc;
  --text:    #c3cee1;
  --muted:   #8d9bb5;
  --heading: #f2f6fb;
  --w: 255,255,255; --bg-rgb: 8,13,23;
  --accent:  rgba(var(--w),.04);
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-feature-settings: 'cv11', 'ss03';
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(56,189,248,.32); color: var(--heading); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(56,189,248,.12), transparent 65%),
    radial-gradient(ellipse 45% 40% at 100% 0%, rgba(99,102,241,.08), transparent 70%);
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(125,211,252,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125,211,252,.03) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 20%, transparent 78%);
          mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 20%, transparent 78%);
}

/* Top bar */
.top-bar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(var(--bg-rgb),.74);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 14px clamp(16px, 3vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.top-bar-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name { color: var(--heading); font-weight: 750; font-size: 1.05rem; letter-spacing: -.03em; line-height: 1.2; }
.brand-sub  { color: var(--muted); font-family: var(--font-mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; }
.back-btn {
  font-size: .84rem; font-weight: 600;
  color: var(--text);
  text-decoration: none; white-space: nowrap;
  border: 1px solid var(--border-bright);
  background: rgba(var(--w),.04);
  padding: 8px 16px; border-radius: 10px;
  transition: background .18s, border-color .18s, color .18s;
}
.back-btn:hover { background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.45); color: var(--heading); }

/* Page */
.container { position: relative; z-index: 1; max-width: 860px; margin: 64px auto; padding: 0 24px 80px; }
.page-header { border-left: 3px solid var(--cyan); padding-left: 22px; margin-bottom: 44px; }
.page-eyebrow {
  display: inline-block;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--cyan-soft);
  padding: 5px 12px; margin-bottom: 14px;
  background: rgba(56,189,248,.1); border: 1px solid rgba(56,189,248,.22); border-radius: 999px;
}
.page-header h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 750; letter-spacing: -.04em; line-height: 1.1; color: var(--heading); margin-bottom: 12px; }
.page-header .meta { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); line-height: 1.7; }

.doc-section {
  background: linear-gradient(180deg, rgba(var(--w),.04), rgba(var(--w),.016)), var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 36px;
  margin-bottom: 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 12px 40px -22px rgba(0,0,0,.7);
}
.doc-section h2 {
  font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em;
  color: var(--heading);
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.doc-section h2::before {
  content: ''; display: inline-block; flex-shrink: 0;
  width: 4px; height: 18px; border-radius: 3px;
  background: linear-gradient(180deg, #7dd3fc, #38bdf8 50%, #6d78f5);
}
.doc-section p { color: var(--text); margin-bottom: 14px; }
.doc-section p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 22px; margin-bottom: 14px; }
li { margin-bottom: 9px; color: var(--text); }
li strong, p strong { color: var(--heading); font-weight: 650; }
code {
  font-family: var(--font-mono); font-size: .86em;
  background: rgba(56,189,248,.08); color: var(--cyan-soft);
  padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(56,189,248,.18);
}
a { color: var(--cyan); text-decoration: none; transition: color .18s; }
a:hover { color: var(--cyan-soft); text-decoration: underline; text-underline-offset: 3px; }

.callout {
  background: rgba(56,189,248,.06);
  border: 1px solid rgba(56,189,248,.22); border-left: 3px solid var(--cyan);
  border-radius: 10px; padding: 16px 20px; margin: 18px 0; font-size: .95rem;
}
.callout strong { color: var(--cyan-soft); }
.callout--warning { background: rgba(251,191,36,.06); border-color: rgba(251,191,36,.25); border-left-color: #fbbf24; }
.callout--warning strong { color: #fbbf24; }

.contact-chips { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.contact-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); border: 1px solid var(--border-bright); border-radius: 10px;
  padding: 11px 18px; color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 500;
  transition: border-color .18s, background .18s, transform .18s;
}
.contact-chip:hover { border-color: rgba(56,189,248,.5); background: rgba(56,189,248,.07); color: var(--heading); text-decoration: none; transform: translateY(-1px); }

.page-footer {
  position: relative; z-index: 1; text-align: center;
  padding: 28px 24px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .78rem; font-family: var(--font-mono); letter-spacing: .02em;
  background: rgba(var(--bg-rgb),.6);
}

@media (max-width: 600px) {
  .top-bar { padding: 12px 16px; }
  .container { margin: 32px auto; padding: 0 16px 60px; }
  .doc-section { padding: 24px 20px; }
  .brand-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ── Theme button and light theme ─────────────────────────── */
.top-bar-actions { display: inline-flex; align-items: center; gap: 12px; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border-bright); background: var(--accent); color: var(--text);
}
.theme-toggle:hover { border-color: var(--cyan); color: var(--heading); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .ti-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ti-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ti-sun { display: block; }
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb; --bg-2: #ffffff; --surface: #ffffff;
  --border: rgba(15,23,42,.12); --border-bright: rgba(15,23,42,.22);
  --cyan: #0369a1; --cyan-soft: #075985;
  --text: #334155; --muted: #55637a; --heading: #0f172a;
  --accent: rgba(15,23,42,.04);
  --w: 15,23,42; --bg-rgb: 244,247,251;
}
:root[data-theme="light"] body::before { opacity: .5; }

/* ── Brand logo: one colouring per theme ── */
.brand-logo { display: block; height: 34px; width: auto; flex-shrink: 0; }
.logo-on-light { display: none; }
:root[data-theme="light"] .logo-on-light { display: block; }
:root[data-theme="light"] .logo-on-dark { display: none; }
