/* CalledIt brand stylesheet for the static pages (methodology, terms,
   privacy, disclaimer). Same tokens, type and chrome as the app shell in
   index.html, which keeps its own inline copy so the SPA paints without an
   extra request. Theme comes from data-theme, set pre-paint from the
   'finx-theme' localStorage key shared with the app. */

:root, :root[data-theme="light"] {
  --paper: #F1F2ED; --sheet: #FBFBF8; --sheet-2: #F6F7F2;
  --ink: #0C1E2C; --body: #384956; --muted: #58656F; --faint: #8C979F;
  --rule: #D6DAD2; --rule-soft: #E4E6DF; --dash: #BCC3BB; --engrave: #2E4B6B;
  --accent: #2447C9; --up: #15684A; --down: #A2342B;
  --down-wash: rgba(162,52,43,.10);
  --tmpl-bg: #F6EFD9; --tmpl-rule: #E3D3A1; --tmpl-ink: #5E4E1E;
  --btn: #0C1E2C; --btn-ink: #F4F5F0;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #08121A; --sheet: #0E1A24; --sheet-2: #0B161F;
  --ink: #ECEFE8; --body: #B5BFC5; --muted: #8D9AA4; --faint: #566470;
  --rule: #1F2F3B; --rule-soft: #16242F; --dash: #2E3E4B; --engrave: #7F9FC7;
  --accent: #8AA2F6; --up: #56C892; --down: #F2846F;
  --down-wash: rgba(242,132,111,.13);
  --tmpl-bg: #221E12; --tmpl-rule: #4A3F22; --tmpl-ink: #D9C88F;
  --btn: #ECEFE8; --btn-ink: #08121A;
  color-scheme: dark;
}
:root {
  --f-display: "Newsreader","Iowan Old Style","Palatino Linotype",Georgia,serif;
  --f-ui: "Hanken Grotesk",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  --f-mono: "JetBrains Mono",ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  --gutter: clamp(16px,4vw,40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { background: var(--paper); color: var(--body); }
body { margin: 0; font: 400 16px/1.6 var(--f-ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, ul, ol { margin: 0; }
h1, h2, h3 { color: var(--ink); font-weight: 400; text-wrap: balance; }
a { color: inherit; }
::selection { background: rgba(36,71,201,.16); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow { font: 500 11px/1.3 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.d-l { font-family: var(--f-display); font-size: clamp(40px,5.4vw,66px); line-height: 1; letter-spacing: -.03em; font-variation-settings: "opsz" 72; }
.lede { font-size: 17px; line-height: 1.65; color: var(--body); max-width: 62ch; }
.fine { font-size: 13px; line-height: 1.55; color: var(--muted); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 84%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--rule-soft); }
.topbar-in { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 500 23px/1 var(--f-display); letter-spacing: -.02em; text-decoration: none; flex: none; }
.brand svg { width: 22px; height: 22px; }
.doc-nav { display: flex; gap: 2px; margin-left: auto; }
.doc-nav a { padding: 10px 12px; border-radius: 4px; font: 400 13px/1 var(--f-mono); color: var(--muted); text-decoration: none; }
.doc-nav a:hover, .doc-nav a[aria-current="page"] { color: var(--ink); }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--ink); background: var(--sheet-2); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* document */
.doc { max-width: 760px; margin-inline: auto; padding: 0 var(--gutter) 40px; }
.doc-head { display: flex; flex-direction: column; gap: 16px; padding-block: clamp(40px,7vw,80px) clamp(24px,4vw,36px); }
.callout { margin-bottom: 24px; padding: 14px 18px; border-radius: 10px; font-size: 14.5px; line-height: 1.6; }
.callout strong { font-weight: 600; }
.callout.lead { background: var(--down-wash); border: 1px solid color-mix(in srgb, var(--down) 35%, transparent); border-left: 3px solid var(--down); color: var(--ink); }
.callout.tmpl { background: var(--tmpl-bg); border: 1px solid var(--tmpl-rule); color: var(--tmpl-ink); font-size: 13px; }
.toc { margin-bottom: 40px; padding: 20px 22px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; }
.toc ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 24px; }
.toc a { font-size: 14.5px; color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.prose { border-top: 1px solid var(--ink); }
.prose section { padding-top: 8px; }
.prose h2 { margin: 36px 0 12px; font: 400 30px/1.12 var(--f-display); letter-spacing: -.02em; color: var(--ink); }
.prose h3 { margin: 22px 0 8px; font: 600 16px/1.35 var(--f-ui); color: var(--ink); }
.prose p { margin-bottom: 14px; font-size: 16px; line-height: 1.7; color: var(--body); }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 1.3rem; font-size: 16px; line-height: 1.7; color: var(--body); }
.prose ul li { list-style: disc; margin-bottom: 6px; }
.prose ol li { list-style: decimal; margin-bottom: 6px; }
.prose li::marker { color: var(--faint); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--dash); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose code { font-family: var(--f-mono); font-size: .86em; padding: .1rem .38rem; background: var(--sheet-2); border: 1px solid var(--rule); border-radius: 4px; color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14.5px; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); text-align: left; vertical-align: top; }
.prose th { font: 500 10.5px/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--rule); }
.prose .small { font-size: 13.5px; color: var(--muted); }
.prose .endnote { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule); }
.anchor:target { scroll-margin-top: 5rem; }

/* footer */
.foot { margin-top: clamp(56px,8vw,96px); padding-bottom: 64px; }
.foot-in { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); column-gap: 24px; row-gap: 28px; padding-top: 36px; border-top: 1px solid var(--ink); }
.foot-brand { grid-column: 1/span 5; display: flex; flex-direction: column; gap: 12px; }
.foot-col { grid-column: span 2; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.foot-col .eyebrow { margin-bottom: 4px; }
.foot-col a { color: var(--body); text-decoration: none; }
.foot-col a:hover { color: var(--ink); }
.foot-fine { grid-column: 1/-1; padding-top: 22px; border-top: 1px solid var(--rule-soft); display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font: 400 12px/1.6 var(--f-mono); color: var(--muted); }

@media (max-width: 760px) {
  .doc-nav a:not([aria-current="page"]) { display: none; }
  .toc ul { grid-template-columns: 1fr; }
  .foot-brand { grid-column: 1/-1; }
  .foot-col { grid-column: span 4; }
}
@media (max-width: 480px) {
  .doc-nav { display: none; }
  .theme-slot { margin-left: auto; }
  .foot-col { grid-column: span 6; }
}
@media print {
  .topbar, .foot, .toc { display: none; }
  html, body { background: #fff; color: #000; }
}
