/* Legal pages: the landing page's ledger system, tuned for long reading. */
:root {
  --paper: #FFFFFF;
  --paper-2: #F4F5F7;
  --paper-3: #ECEEF2;
  --ink: #0B0D12;
  --ink-2: #4B5060;
  --ink-3: #6A6F7D;
  --rule: rgba(11, 13, 18, 0.12);
  --blue: #0B4DFF;
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --serif: 'Libre Caslon Text', Georgia, serif;
  --weight: cubic-bezier(0.7, 0, 0.2, 1);
  --gutter: clamp(20px, 4.5vw, 64px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 32px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--blue); color: #fff; }
a { -webkit-tap-highlight-color: transparent; }
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

/* Prose links: underline that thickens and lifts on hover */
.prose a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(11, 77, 255, 0.35);
  overflow-wrap: anywhere;
  transition: text-decoration-color 0.3s ease, text-underline-offset 0.35s var(--weight), text-decoration-thickness 0.35s var(--weight);
}
@media (hover: hover) { .prose a:hover { text-decoration-color: var(--blue); text-underline-offset: 5px; text-decoration-thickness: 2px; } }
.prose a:active { color: var(--ink); }

main {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) clamp(96px, 12vw, 168px) max(var(--gutter), env(safe-area-inset-left));
}

/* Top bar, same as the landing page */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(30px + env(safe-area-inset-top)) 0 28px;   /* clear of the status bar and notch (viewport-fit=cover) */
  position: relative;
}
.top::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule) 12%, var(--rule) 88%, transparent);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand img { display: block; width: 30px; height: 30px; transition: transform 0.6s var(--weight); }
@media (hover: hover) { .brand:hover img { transform: rotate(90deg); } }
.brand span {
  font-family: var(--display);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  transition: color 0.3s ease;
}
@media (hover: hover) { .brand:hover span { color: var(--blue); } }

/* Title block */
.doc-head {
  padding: clamp(72px, 9vw, 136px) 0 clamp(48px, 6vw, 80px);
  margin-bottom: clamp(48px, 6vw, 88px);
  position: relative;
}
.doc-head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 35%, var(--rule) 100%);
}
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(60px, 10vw, 152px);
  line-height: 0.82;
  letter-spacing: -0.012em;
  max-width: 11ch;
}
.meta {
  margin: 28px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.meta span {
  display: inline-block;
  padding: 7px 12px 6px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px rgba(11, 13, 18, 0.08), inset 0 1px 0 #fff;
}

/* Two columns: sticky contents rail + reading column */
.doc {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: clamp(48px, 7vw, 120px);
  align-items: start;
}
.doc-single { grid-template-columns: minmax(0, 1fr); }

.toc {
  position: sticky;
  top: 32px;
  padding: 22px 20px 18px;
  background: linear-gradient(170deg, #FFFFFF, var(--paper-2));
  box-shadow:
    inset 0 0 0 1px rgba(11, 13, 18, 0.07),
    inset 0 2px 0 #fff,
    0 24px 48px -36px rgba(11, 13, 18, 0.35);
}
.toc-title {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--blue);
}
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc a {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 6px;
  padding: 7px 0 7px 12px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.3s ease, padding-left 0.4s var(--weight);
}
.toc a span {
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  padding-top: 2px;
  transition: color 0.3s ease;
}
/* Active marker: a bar that grows in from the top */
.toc a::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--blue);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--weight);
}
@media (hover: hover) { .toc a:hover { color: var(--ink); padding-left: 16px; } }
.toc a:active { color: var(--blue); }
.toc a[aria-current="true"] { color: var(--ink); font-weight: 500; }
.toc a[aria-current="true"] span { color: var(--blue); }
.toc a[aria-current="true"]::before { transform: scaleY(1); }

/* Reading column */
.prose { max-width: 72ch; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 16px; }
.lead {
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-bottom: 40px !important;
}
h2 {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin: clamp(64px, 7vw, 96px) 0 20px;
  padding-top: 22px;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(32px, 3.4vw, 46px);
  line-height: 0.92;
  letter-spacing: 0.005em;
  position: relative;
}
.prose > h2:first-child { margin-top: 0; }
h2::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 18%, var(--rule) 100%);
}
h2 .idx {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--blue);
  transform: translateY(-0.9em);
}
em { font-family: var(--serif); font-style: italic; color: var(--ink-2); letter-spacing: -0.01em; }
strong { font-weight: 600; }
/* Labels ("VAT:", "Active members:") read as small-caps metadata */
.lbl {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
}
ul, ol { margin: 0 0 20px; padding-left: 22px; }
.prose li { margin: 0 0 8px; padding-left: 4px; }
.prose li::marker { color: var(--blue); }
code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 2px 7px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px rgba(11, 13, 18, 0.08), inset 0 1px 0 #fff;
}

/* Tables sit on a raised sheet */
.table-wrap {
  overflow-x: auto;
  margin: 12px 0 24px;
  padding: 6px 22px 8px;
  background: linear-gradient(175deg, #FFFFFF, var(--paper-2));
  box-shadow:
    inset 0 0 0 1px rgba(11, 13, 18, 0.07),
    inset 0 2px 0 #fff,
    0 20px 40px -32px rgba(11, 13, 18, 0.3);
}
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; }
th {
  text-align: left;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 14px 18px 12px 0;
  border-bottom: 1px solid var(--ink);
}
td { vertical-align: top; padding: 14px 18px 14px 0; border-bottom: 1px solid var(--rule); }
tr:last-child td { border-bottom: 0; }

/* Footer: a drawer set into the page, same as the landing page */
.legal-foot {
  background: var(--paper-2);
  box-shadow: inset 0 1px 0 rgba(11, 13, 18, 0.1), inset 0 18px 30px -24px rgba(11, 13, 18, 0.18);
  padding: 36px var(--gutter) calc(48px + env(safe-area-inset-bottom));
}
.legal-foot div {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px 40px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.legal-foot nav { display: flex; flex-wrap: wrap; gap: 12px 26px; }
.legal-foot .foot-note { margin: 10px 0 0; font-size: 11px; color: var(--ink-3); }
.legal-foot a {
  color: inherit;
  text-decoration: none;
  background: linear-gradient(var(--blue), var(--blue)) left bottom / 0 1px no-repeat;
  padding-bottom: 3px;
  transition: color 0.3s ease, background-size 0.45s var(--weight);
}
@media (hover: hover) { .legal-foot a:hover, .legal-foot a[aria-current="page"] { color: var(--blue); background-size: 100% 1px; } }
.legal-foot a:active { color: var(--ink); }

h1, h2, .lead { text-wrap: balance; }

/* Small screens: the rail becomes a sticky strip of section chips */
@media (max-width: 900px) {
  html { scroll-padding-top: calc(88px + env(safe-area-inset-top)); }
  .doc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc {
    top: 0;
    z-index: 20;
    margin: 0 calc(var(--gutter) * -1) 48px;
    padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;   /* the chips stay clear of the status bar */
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
            backdrop-filter: blur(12px) saturate(1.4);
    box-shadow: inset 0 -1px 0 var(--rule), 0 12px 24px -20px rgba(11, 13, 18, 0.35);
  }
  .toc-title { display: none; }
  .toc ol {
    position: relative; /* offsetParent for the chip scroll */
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .toc ol::-webkit-scrollbar { display: none; }
  .toc a {
    display: flex;
    gap: 8px;
    white-space: nowrap;
    padding: 8px 12px 7px;
    font-size: 13.5px;
    background: var(--paper-2);
    box-shadow: inset 0 0 0 1px rgba(11, 13, 18, 0.07), inset 0 1px 0 #fff;
    transition: background 0.35s var(--weight), color 0.3s ease, box-shadow 0.35s var(--weight);
  }
  .toc a::before { display: none; }
  .toc a:hover { padding-left: 12px; }
  .toc a[aria-current="true"] {
    background: var(--ink);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 6px 14px -8px rgba(11, 13, 18, 0.6);
  }
  .toc a[aria-current="true"] span { color: #9DB5FF; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  h2 { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Font roles (13 Nov 2026): a sentence is body text, not a mono label. The guides index lists a sentence under each link. */
.prose li .meta { font-family: var(--body); font-size: 14px; letter-spacing: 0; text-transform: none; }
