/* The legal pages at https://phantombrain.app/legal (phantom-partners, web/legal/).
   Every rule lives here, never inline: the site's CSP is style-src 'self'.
   The fonts and colour tokens are the presentation page's (web/home/home.css). */

:root { color-scheme: light; }
[hidden] { display: none !important; }

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Paper and ink, 2px rules, square corners, one red, Archivo throughout. */
:root {
  --ink: #201E1D;
  --paper: #F3F2F2;
  --well: #EAE9E9;
  --card: #FFFFFF;
  --line: #C9C6C5;
  --sub: #5F5C5A;
  --accent: #EC3013;
  --accent-text: #BD250D;

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 56px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --measure: 44rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #EFEDEC; --paper: #1A1918; --well: #242221; --card: #262423; --line: #3D3A39;
    --sub: #B4B0AE; --accent: #FF4B2E; --accent-text: #FF6A50;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-padding-top: calc(var(--nav-h) + 16px + env(safe-area-inset-top, 0px));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 40; background: var(--ink); color: var(--paper); padding: 10px 14px; font-weight: 800; text-decoration: none; }
.skip:focus { top: calc(8px + env(safe-area-inset-top, 0px)); color: var(--paper); }

.wrap {
  max-width: 1240px;
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
@media (min-width: 720px) {
  .wrap {
    padding-left: max(40px, env(safe-area-inset-left, 0px));
    padding-right: max(40px, env(safe-area-inset-right, 0px));
  }
}

/* ---------- header ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.nav-row { display: flex; align-items: center; gap: 20px; height: var(--nav-h); }
.wordmark { display: inline-flex; align-items: baseline; gap: 3px; text-decoration: none; color: var(--ink); }
.wordmark:hover { color: var(--ink); }
.wordmark-text { font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: -0.045em; white-space: nowrap; }
.wordmark-square { width: 7px; height: 7px; background: var(--accent); flex: none; }
.nav-links { display: flex; gap: clamp(14px, 2.4vw, 26px); margin-left: auto; }
.nav-links a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--sub);
  padding-block: 6px;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 400px) {
  .wordmark-text { font-size: 19px; }
  .nav-row { gap: 12px; }
}

/* ---------- the document ---------- */
.legal { padding-top: clamp(32px, 6vw, 64px); padding-bottom: clamp(48px, 8vw, 96px); }
.legal > * { max-width: var(--measure); }
.legal > .legal-table { max-width: none; }

.kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--sub);
}
.legal h1 {
  margin: 12px 0 14px;
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.legal h2 {
  margin: 56px 0 14px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.legal h3 {
  margin: 30px 0 8px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.legal p { margin: 0 0 14px; text-wrap: pretty; }
.legal ul, .legal ol { margin: 0 0 16px; padding-left: 1.35em; }
.legal li { margin: 6px 0; text-wrap: pretty; }
.legal li > ul, .legal li > ol { margin: 6px 0 0; }
.legal ul > li::marker { color: var(--accent); }
.legal strong { font-weight: 750; }
.legal address { font-style: normal; }
.legal code { font-size: 0.92em; }

.legal-meta { margin: 0 0 8px; font-weight: 600; color: var(--sub); font-variant-numeric: tabular-nums; }
.legal-related { color: var(--sub); }
.legal .lead { font-size: clamp(19px, 2vw, 22px); line-height: 1.45; }

.legal-summary {
  margin: 32px 0;
  padding: 22px 24px 8px;
  background: var(--card);
  border: 2px solid var(--ink);
}
.legal .legal-summary h2,
.legal .legal-toc h2 {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.legal-summary p { color: var(--sub); font-size: 15px; }

.legal-toc { margin: 32px 0 8px; }
.legal .legal-toc ol { margin: 0; padding-left: 1.8em; }
.legal .legal-toc li { margin: 3px 0; }
.legal-toc a { text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }
@media (min-width: 720px) {
  .legal .legal-toc ol { columns: 2; column-gap: 40px; }
  .legal .legal-toc li { break-inside: avoid; }
}

/* ---------- tables: rows of label and text; stacked on phones ---------- */
.legal-table { margin: 18px 0 26px; overflow-x: auto; }
.legal-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.legal-table th,
.legal-table td { padding: 12px 14px 12px 0; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.legal-table thead th {
  padding-top: 0;
  border-top: 0;
  border-bottom: 2px solid var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sub);
}
.legal-table tbody tr:first-child td { border-top: 0; }
.legal-table td:first-child { font-weight: 750; min-width: 9em; }
.legal-table td p { margin: 0 0 8px; }
.legal-table td p:last-child { margin: 0; }
@media (max-width: 719px) {
  .legal-table { overflow: visible; }
  .legal-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .legal-table table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; }
  .legal-table tr { padding: 12px 0; border-top: 2px solid var(--ink); }
  .legal-table td { padding: 4px 0; border: 0; }
  .legal-table td:first-child { font-size: 17px; min-width: 0; }
  .legal-table td + td::before {
    content: attr(data-label);
    display: block;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sub);
  }
}

/* ---------- the hub ---------- */
.legal .docs { display: grid; gap: 14px; margin: 28px 0 8px; padding: 0; list-style: none; }
.legal .docs li { margin: 0; }
.doc-card {
  display: block;
  padding: 20px 22px;
  background: var(--card);
  border: 2px solid var(--ink);
  text-decoration: none;
}
.doc-card:hover { border-color: var(--accent); color: var(--ink); }
.doc-card strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.doc-card .legal-meta { display: block; margin: 4px 0 8px; font-size: 14px; }
.doc-card span:last-child { display: block; color: var(--sub); font-size: 15px; line-height: 1.5; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0 0 16px; }
.facts dt { font-weight: 600; color: var(--sub); }
.facts dd { margin: 0; }
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
}

/* ---------- footer ---------- */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
  color: var(--sub);
}
.site-foot p { margin: 0; max-width: 52em; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }

@media print {
  :root { --ink: #000; --paper: #fff; --card: #fff; --sub: #333; --line: #999; --accent: #000; --accent-text: #000; color-scheme: light; }
  body { font-size: 11pt; line-height: 1.45; }
  .nav, .skip, .site-foot nav, .legal-toc { display: none; }
  .legal { padding: 0; }
  .legal > * { max-width: none; }
  .legal h2 { break-after: avoid; }
  .legal h3 { break-after: avoid; }
  .legal-table tr { break-inside: avoid; }
  a { text-decoration: none; }
}
