@font-face {
  font-family: "Inter Polymarket";
  src: url("assets/inter-polymarket.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #12151a;
  --muted: #606975;
  --paper: #f7f8fa;
  --surface: #ffffff;
  --surface-low: #f1f3f6;
  --surface-high: #e9edf2;
  --line: #d9dee5;
  --outline: #aab2bd;
  --blue: #2f5bff;
  --blue-deep: #173ea5;
  --blue-container: #dde5ff;
  --blue-container-ink: #00164f;
  --page-width: 760px;
  --side-space: 16px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(82px + env(safe-area-inset-top));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter Polymarket", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--blue-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:focus-visible {
  outline: 3px solid rgba(47, 91, 255, 0.28);
  outline-offset: 2px;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid rgba(217, 222, 229, 0.86);
  background: rgba(247, 248, 250, 0.92);
  box-shadow: 0 1px 0 rgba(18, 21, 26, 0.02);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
}

.header-inner {
  width: min(var(--page-width), calc(100% - 2 * var(--side-space)));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  min-width: 0;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.1px;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.legal-nav {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 14px;
  background: var(--surface-high);
}

.legal-nav a {
  padding: 8px 11px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.legal-nav a:hover { color: var(--ink); }

.legal-nav a[aria-current="page"] {
  color: var(--blue-deep);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(18, 21, 26, 0.12);
}

.hero {
  width: min(var(--page-width), calc(100% - 2 * var(--side-space)));
  margin: 0 auto;
  padding: 36px 4px 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
}

.lede {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-high);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
}

.layout {
  width: min(var(--page-width), calc(100% - 2 * var(--side-space)));
  margin: 0 auto 56px;
}

.toc {
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.toc-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  columns: 3;
  column-gap: 12px;
  list-style: none;
}

.toc li { break-inside: avoid; }
.toc li + li { margin-top: 2px; }

.toc a {
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-decoration: none;
}

.toc a:hover {
  color: var(--blue-deep);
  background: var(--blue-container);
}

.document {
  display: grid;
  gap: 0;
}

.notice,
.document section {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.notice {
  position: relative;
  margin-bottom: 14px;
  padding: 18px 20px 18px 54px;
  border-color: #c5d1ff;
  background: var(--blue-container);
  color: var(--blue-container-ink);
}

.notice::before {
  content: "✓";
  position: absolute;
  top: 18px;
  left: 18px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.notice-warning {
  border-color: #f1c46b;
  background: #fff4d8;
  color: #4c3100;
}

.notice-warning::before {
  content: "!";
  background: #b86800;
}

.document section {
  padding: 26px 28px;
  border-top-width: 0;
  border-bottom-width: 0;
  border-radius: 0;
  scroll-margin-top: calc(82px + env(safe-area-inset-top));
}

.document section:nth-of-type(4n + 1) {
  margin-top: 14px;
  border-top-width: 1px;
  border-radius: 20px 20px 0 0;
}

.document section:nth-of-type(4n),
.document section:last-of-type {
  border-bottom-width: 1px;
  border-radius: 0 0 20px 20px;
}

.document section:nth-of-type(4n):not(:last-of-type) {
  margin-bottom: 0;
}

.document section + section { box-shadow: inset 0 1px var(--line); }
.document section:nth-of-type(4n + 1) { box-shadow: none; }

h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.25px;
}

h3 {
  margin: 22px 0 7px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.1px;
}

p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
ul { margin: 12px 0 16px; padding-left: 1.25rem; }
li { padding-left: 2px; }
li + li { margin-top: 7px; }
li::marker { color: var(--blue); }
strong { color: var(--ink); font-weight: 700; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.footer-inner {
  width: min(var(--page-width), calc(100% - 2 * var(--side-space)));
  min-height: 96px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-inner p { margin: 0; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }

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

@media (max-width: 560px) {
  :root { --side-space: 16px; }

  .header-inner { min-height: 56px; gap: 10px; }
  .brand { flex: 0 0 auto; }
  .brand span { display: none; }
  .brand img { width: 38px; height: 38px; }
  .legal-nav { flex: 1; }
  .legal-nav a { flex: 1; padding: 8px 6px; text-align: center; }

  .hero { padding: 22px 4px 18px; }
  .eyebrow { margin-bottom: 6px; font-size: 11px; }
  h1 { font-size: 26px; letter-spacing: -0.65px; }
  .lede { font-size: 14px; }
  .meta { margin-top: 12px; }

  .toc {
    margin: 0 calc(-1 * var(--side-space)) 14px;
    padding: 0 var(--side-space) 2px;
    overflow-x: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .toc::-webkit-scrollbar { display: none; }
  .toc-title { display: none; }
  .toc ol {
    display: flex;
    width: max-content;
    columns: auto;
    gap: 8px;
  }
  .toc li + li { margin-top: 0; }
  .toc a {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
  }
  .layout { margin-bottom: 40px; }
  .notice { padding: 16px 16px 16px 50px; border-radius: 18px; }
  .notice::before { top: 16px; left: 16px; }
  .document section { padding: 21px 20px; }
  .document section:nth-of-type(4n + 1) {
    margin-top: 12px;
    border-radius: 18px 18px 0 0;
  }
  .document section:nth-of-type(4n),
  .document section:last-of-type {
    border-radius: 0 0 18px 18px;
  }
  h2 { font-size: 18px; }
  h3 { font-size: 15px; }

  .footer-inner {
    min-height: 0;
    padding: 24px 4px calc(24px + env(safe-area-inset-bottom));
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

@media print {
  body { background: white; font-size: 11pt; }
  .site-header, .toc, .site-footer { display: none; }
  .hero { padding: 0 0 24px; }
  .layout { display: block; width: 100%; margin: 0; }
  .document { display: block; }
  .notice, .document section { padding: 0; border: 0; border-radius: 0; }
  .notice { margin-bottom: 28px; }
  .notice::before { display: none; }
  .document section + section { margin-top: 28px; }
  .document section { break-inside: avoid; }
}
