/* Legal pages (privacy policy, accessibility statement). Same tokens and components as index.html;
   keep the two in sync when colours or type change. Generated pages: legal/build_pages.py */
@font-face { font-family: "Geist"; src: url(fonts/geist-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #F7F8FA; --surface: #FFFFFF; --ink: #132033; --navy: #182D45; --muted: #556275; --line: #DFE4EA;
  --field: #848FA0; --blue: #0086FF; --blue-text: #0067C7; --err: #B42318; --btn-bg: #182D45; --btn-fg: #FFFFFF;
  --btn-hover: #0E1F33; --hint: #EEF4FB; --shadow: 0 1px 0 rgba(24, 45, 69, .03), 0 28px 56px -32px rgba(24, 45, 69, .22);
  --logo-filter: none; --r: 4px; --gut: clamp(16px, 5vw, 72px);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --label: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B121C; --surface: #111B28; --ink: #E3E9F0; --navy: #EEF2F6; --muted: #9AA7B7; --line: #223142;
  --field: #607189; --blue: #3D9DFF; --blue-text: #6BB6FF; --err: #FF8A7A; --btn-bg: #E9EEF4; --btn-fg: #0B121C;
  --btn-hover: #FFFFFF; --hint: #13253A; --shadow: 0 28px 56px -32px rgba(0, 0, 0, .6); --logo-filter: invert(1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0B121C; --surface: #111B28; --ink: #E3E9F0; --navy: #EEF2F6; --muted: #9AA7B7; --line: #223142;
    --field: #607189; --blue: #3D9DFF; --blue-text: #6BB6FF; --err: #FF8A7A; --btn-bg: #E9EEF4; --btn-fg: #0B121C;
    --btn-hover: #FFFFFF; --hint: #13253A; --shadow: 0 28px 56px -32px rgba(0, 0, 0, .6); --logo-filter: invert(1);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* smooth anchor scrolling only with a mouse: on iPhone it fights Safari's own scroll to a focused field */
@media (prefers-reduced-motion: no-preference) and (pointer: fine) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 var(--font); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
h1, h2, h3, p, ul, ol, dd { margin: 0; }
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 1280px; margin: 0 auto; padding-inline: var(--gut); }
.skip { position: absolute; left: 16px; top: -100px; z-index: 40; padding: 10px 14px; background: var(--btn-bg); color: var(--btn-fg); border-radius: var(--r); text-decoration: none; font-size: 0.875rem; }
.skip:focus { top: 16px; }

.eyebrow { font: 600 0.75rem/1 var(--label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue-text); }
.fine { font-size: 0.8125rem; line-height: 1.55; color: var(--muted); }
.h3 { font-size: 1.375rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; color: var(--navy); }

/* buttons, links, switch (as on the landing page) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 24px; border: 1px solid var(--btn-bg); border-radius: var(--r);
  background: var(--btn-bg); color: var(--btn-fg); font: 500 0.9375rem/1 var(--font);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 0.875rem; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.lnk { font-size: 0.9375rem; color: var(--navy); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; }
.lnk:hover { text-decoration-color: var(--navy); }
.linklike { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--navy); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.linklike:hover { text-decoration-color: var(--navy); }
.theme-switch {
  position: relative; flex: none; width: 46px; height: 26px; padding: 0; cursor: pointer;
  border: 1px solid var(--field); border-radius: 999px; background: var(--surface);
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.theme-switch .knob {
  position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--navy); transition: transform .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.theme-switch:hover { border-color: var(--navy); }
.theme-switch[aria-checked="true"] { background: var(--hint); }
.theme-switch[aria-checked="true"] .knob { transform: translateX(20px); background: transparent; box-shadow: inset -5px -3px 0 0 var(--navy); }

/* nav: always solid on the document pages */
.nav { position: sticky; top: 0; z-index: 30; height: 72px; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav-in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: block; line-height: 0; }
.brand img { height: 34px; width: auto; filter: var(--logo-filter); }
.nav-links { display: flex; align-items: center; gap: 28px; }

/* document */
.doc { padding: clamp(56px, 8vw, 104px) 0 clamp(72px, 10vw, 128px); }
.doc-grid {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-areas: "toc head" "toc body";
  gap: 0 clamp(40px, 7vw, 112px); align-items: start;
}
.doc-head { grid-area: head; max-width: 70ch; }
.prose { grid-area: body; }
.toc { grid-area: toc; align-self: start; position: sticky; top: 112px; }
.toc ol { list-style: none; padding: 0; margin-top: 20px; display: grid; gap: 10px; counter-reset: none; }
.toc a { font-size: 0.875rem; line-height: 1.4; color: var(--muted); text-decoration: none; display: block; }
.toc a:hover, .toc a[aria-current="true"] { color: var(--navy); }
.toc a[aria-current="true"] { box-shadow: inset 2px 0 0 var(--blue); padding-left: 10px; margin-left: -12px; }

.prose { max-width: 70ch; }
.doc-head h1 { margin-top: 24px; font-size: clamp(2.4rem, 1.5rem + 3vw, 3.75rem); font-weight: 500; letter-spacing: -0.04em; line-height: 1.02; color: var(--navy); }
.doc-head .updated { margin-top: 20px; font: 500 0.8125rem/1.4 var(--label); color: var(--muted); }
.doc-head .intro { margin-top: 28px; font-size: 1.1875rem; line-height: 1.55; color: var(--muted); }
.prose section { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); scroll-margin-top: 96px; }
.prose section:first-child { margin-top: 48px; }
.prose h2 { font-size: clamp(1.4rem, 1.15rem + 0.8vw, 1.75rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.2; color: var(--navy); }
.prose p, .prose ul, .prose .table-wrap { margin-top: 18px; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 20px; display: grid; gap: 8px; }
.prose li::marker { color: var(--muted); }
.num { font: 500 0.8em/1 var(--label); color: var(--blue-text); margin-right: 0.25em; }
.toc .num { font-size: 0.75rem; }
.prose b { font-weight: 600; color: var(--navy); }
.prose a { color: var(--blue-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose code { font: 0.875em/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 5px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }

.table-wrap { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; }
.prose th { text-align: left; font: 600 0.6875rem/1.3 var(--label); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--line); }
.prose td { padding: 14px 16px; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--navy); font-weight: 500; }

/* footer (as on the landing page, short notice only) */
.foot { border-top: 1px solid var(--line); padding: 48px 0 56px; }
.foot-in { display: grid; grid-template-columns: auto 1fr; gap: 20px 64px; align-items: start; }
.foot img { height: 26px; width: auto; display: block; filter: var(--logo-filter); }
.foot .fine { max-width: 82ch; }
.legal { display: grid; gap: 16px; }
.foot .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot .meta a { color: var(--navy); }
.foot .meta a[aria-current="page"] { text-decoration-color: var(--blue); }

/* contact dialog (as on the landing page) */
.leave {
  width: min(520px, calc(100vw - 32px)); padding: clamp(24px, 4vw, 36px); border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}

/* phones: dialogs sit at the top, so the on-screen keyboard never covers their fields */
@media (max-width: 820px) {
  .leave { margin: max(12px, env(safe-area-inset-top)) auto auto; max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
}
.leave::backdrop { background: rgba(11, 18, 28, .45); }
.leave p { margin-top: 12px; color: var(--muted); }
.leave-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field label { font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.field .opt { font-weight: 400; color: var(--muted); }
input[type="email"], input[type="text"] {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--field); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: 400 1rem/1 var(--font);
}
textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--field); border-radius: var(--r); background: var(--surface); color: var(--ink); font: 400 1rem/1.5 var(--font); resize: vertical; min-height: 96px; }
input:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0, 134, 255, .22); }
[aria-invalid="true"] { border-color: var(--err); }
.err { font-size: 0.8125rem; color: var(--err); }
.err:empty { display: none; }
.form-status { margin-top: 14px; font-size: 0.875rem; color: var(--err); }
.form-status:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.done:focus { outline: none; }
.contact form > p.fine { margin-top: 4px; }
.contact .field:first-of-type { margin-top: 22px; }

/* embedded in Wix: the host page has the header, so only the theme switch stays, floating top right */
.embedded .nav { position: fixed; top: 16px; left: 0; right: 0; height: auto; background: none; border: 0; pointer-events: none; }
.embedded .nav .brand, .embedded .nav .lnk, .embedded .nav .btn { display: none; }
.embedded .nav-in { justify-content: flex-end; }
.embedded .theme-switch { pointer-events: auto; }
.embedded .doc { padding-top: 56px; }
.embedded .toc { top: 24px; }

@media (max-width: 900px) {
  /* the contents list moves above the text as a boxed list */
  .doc-grid { grid-template-columns: 1fr; grid-template-areas: "head" "toc" "body"; gap: 32px; }
  .toc { position: static; padding: 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
  .toc ol { margin-top: 14px; }
  .prose section:first-child { margin-top: 8px; }
}
@media (max-width: 820px) {
  .nav { height: 64px; }
  .brand img { height: 28px; }
  .foot-in { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* tables become stacked cards: each cell carries its column name */
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .prose tr:last-child { border-bottom: 0; }
  .prose td { padding: 0; border: 0; }
  .prose td + td { margin-top: 10px; }
  .prose td + td::before { content: attr(data-label); display: block; margin-bottom: 2px; font: 600 0.6875rem/1.3 var(--label); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
}
@media (max-width: 560px) { .nav-links .lnk { display: none; } }

/* content pages: methodology, insights */
.prose h3 { margin-top: 32px; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; color: var(--navy); }
.prose h2 + h3 { margin-top: 20px; }
.prose ol { margin-top: 18px; padding-left: 22px; display: grid; gap: 8px; }
.doc-head .eyebrow a { color: inherit; text-decoration: none; }
.doc-head .eyebrow a:hover { text-decoration: underline; }
.doc-head .intro a, .prose .article-note a { color: var(--blue-text); }
.article-note { margin-top: 56px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 0.9375rem; color: var(--muted) !important; }
/* pages without a contents list (insights index, 404) */
.doc-grid.no-toc { grid-template-areas: ". head" ". body"; }
.no-toc .prose { max-width: 70ch; }
.prose .posts { list-style: none; padding: 0; margin-top: 40px; display: block; }
.post { padding: 28px 0; border-top: 1px solid var(--line); }
.post:last-child { border-bottom: 1px solid var(--line); }
.post h2 { margin-top: 8px; font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.6rem); }
.post h2 a { color: var(--navy); text-decoration: none; }
.post h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.post p:not(.updated) { margin-top: 10px; color: var(--muted); }
.post .updated { font: 500 0.8125rem/1.4 var(--label); color: var(--muted); }
.nav-links .lnk[aria-current="page"] { text-decoration-color: var(--blue); }
@media (max-width: 720px) { .nav-links { gap: 18px; } }
@media (max-width: 900px) { .doc-grid.no-toc { grid-template-areas: "head" "body"; } }
