/* CustomsCopilot — legal pages stylesheet
   Matches the marketing site: Space Grotesk display, Inter body,
   JetBrains Mono labels, dark navy surface with the grid backdrop. */

:root {
  --bg: #0A1120;
  --surface: #0F1B2E;
  --surface-2: #16233A;
  --border: #1E2E48;
  --text: #E6EDF7;
  --text-muted: #93A4BE;
  --accent: #14B8A6;
  --mint: #5EEAD4;
  --cream: #ECE9E4;
  --accent-soft: rgba(20, 184, 166, 0.10);
  --warn-bg: rgba(217, 119, 6, 0.10);
  --warn-border: rgba(217, 119, 6, 0.45);
  --maxw: 74ch;

  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ---------- Grid backdrop ---------- */

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background-image:
    linear-gradient(to right, rgba(94, 234, 212, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(94, 234, 212, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 35%, transparent 100%);
}

body::after {
  background: radial-gradient(ellipse 60% 40% at 50% -5%, rgba(13, 148, 136, 0.18), transparent 70%);
}

.legal-header, main, .legal-footer { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---------- Header ---------- */

.legal-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 27, 46, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.legal-header__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }

.brand__mark { width: 30px; height: 30px; flex-shrink: 0; border-radius: 7px; display: block; }

.brand__text {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand__customs { color: var(--cream); }
.brand__copilot { color: var(--mint); }

.back-link {
  font-size: 14px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 8px 15px;
  border-radius: 9px;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.back-link:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

/* ---------- Layout ---------- */

main { max-width: var(--maxw); margin: 0 auto; padding: 60px 24px 96px; }

.doc-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  font-weight: 700;
}

.doc-meta { color: var(--text-muted); font-size: 14px; margin: 0 0 8px; }
.doc-meta strong { color: var(--text); font-weight: 600; }

.lede {
  font-size: 17px;
  color: var(--text-muted);
  margin: 28px 0 0;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

/* ---------- Sections ---------- */

section { margin-top: 46px; scroll-margin-top: 24px; }

h2 {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-weight: 600;
  display: flex;
  gap: 12px;
  align-items: baseline;
}

h2 .num {
  font-family: var(--font-mono);
  color: var(--mint);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

h3 {
  font-family: var(--font-display);
  font-size: 16.5px;
  margin: 28px 0 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 8px; }
li::marker { color: var(--accent); }
strong { font-weight: 600; color: var(--text); }

/* ---------- Table ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 0 16px;
  background: rgba(15, 27, 46, 0.6);
}

table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 460px; }
th, td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--border); vertical-align: top; }

th {
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

tbody tr:last-child td { border-bottom: none; }

/* ---------- Callouts ---------- */

.callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 16px 18px;
  margin: 0 0 18px;
}
.callout p:last-child { margin-bottom: 0; }
.callout--warn { background: var(--warn-bg); border-left-color: var(--warn-border); }

/* ---------- TOC ---------- */

.toc {
  background: rgba(15, 27, 46, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 26px;
  margin: 32px 0 0;
}
.toc h2 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0 0 14px;
  display: block;
}
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; font-size: 14.5px; }
.toc li { margin-bottom: 7px; break-inside: avoid; }
.toc a { color: var(--text-muted); }
.toc a:hover { color: var(--mint); }

@media (max-width: 620px) { .toc ol { columns: 1; } }

/* ---------- Footer ---------- */

.legal-footer {
  border-top: 1px solid var(--border);
  background: rgba(15, 27, 46, 0.72);
  padding: 28px 24px;
  color: var(--text-muted);
  font-size: 14px;
}
.legal-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.legal-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.legal-footer a { color: var(--text-muted); }
.legal-footer a:hover { color: var(--mint); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
