/* Legal documents: the cabinet's tokens, type and dark theme. */
@font-face { font-family: Onest; src: url('/legal/assets/onest.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Unbounded; src: url('/legal/assets/unbounded.ttf') format('truetype'); font-weight: 200 900; font-display: swap; }

:root {
  color-scheme: light;
  --background: #fff;
  --foreground: #0d0d0d;
  --muted: #f4f4f2;
  --muted-foreground: #626262;
  --border: #d5d5d5;
  --frame: #fff;
  --accent: #171717;
  --accent-foreground: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #161616;
    --foreground: #f5f5f3;
    --muted: #242424;
    --muted-foreground: #aaa;
    --border: #414141;
    --frame: #1c1c1c;
    --accent: #f5f5f3;
    --accent-foreground: #161616;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--background); color: var(--foreground); font: 400 16px/1.7 Onest, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 4px; }
::selection { background: #dadada; color: #0d0d0d; }

.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--background) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.bar-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { font-family: Unbounded, sans-serif; font-size: 18px; font-weight: 800; letter-spacing: .03em; text-decoration: none; }
.bar-links { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.bar-links a:not(.enter) { color: var(--muted-foreground); text-decoration: none; }
.bar-links a:not(.enter):hover, .bar-links a[aria-current] { color: var(--foreground); }
.enter { background: var(--accent); color: var(--accent-foreground); text-decoration: none; padding: 9px 18px; border-radius: 10px; font-weight: 500; }
.enter:hover { opacity: .88; }

.page { max-width: 1200px; margin: 0 auto; padding: 48px 24px 96px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 36px; padding: 0; list-style: none; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); }
.crumbs li:not(:last-child)::after { content: '/'; margin-left: 10px; opacity: .6; }
.crumbs a { text-decoration: none; color: var(--foreground); }
.crumbs a:hover { text-decoration: underline; }
.crumbs li:last-child { max-width: 48ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 72px; align-items: start; }
.doc { max-width: 760px; min-width: 0; }
h1 { margin: 0; font-family: Unbounded, sans-serif; font-weight: 700; font-size: clamp(28px, 4.2vw, 50px); line-height: 1.15; letter-spacing: -.035em; text-wrap: balance; }
.edition { margin: 22px 0 0; color: var(--muted-foreground); font-size: 15px; }
.draft { display: inline-flex; align-items: center; gap: 10px; margin: 24px 0 8px; padding: 8px 14px; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); font-size: 13px; }
.draft::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #e6b367; }

.doc h2 { margin: 56px 0 16px; font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; scroll-margin-top: 96px; }
.doc p { margin: 0 0 14px; }
.doc .clause { display: grid; grid-template-columns: 56px minmax(0, 1fr); }
.doc .clause > .num { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.doc ul { margin: 4px 0 18px; padding: 0 0 0 56px; list-style: none; }
.doc li { position: relative; margin: 0 0 8px; }
.doc li::before { content: ''; position: absolute; left: -20px; top: .78em; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-foreground); }
.doc code { font: .92em ui-monospace, 'Geist Mono', monospace; background: var(--muted); padding: 1px 6px; border-radius: 6px; }
.blank { background: var(--muted); border: 1px dashed var(--border); border-radius: 6px; padding: 0 6px; white-space: nowrap; }
.table { margin: 16px 0 24px; border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; }
.table table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.table th { background: var(--muted); font-weight: 600; text-align: left; }
.table th, .table td { padding: 12px 16px; vertical-align: top; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }
.table td + td, .table th + th { border-left: 1px solid var(--border); }

.toc { position: sticky; top: 104px; max-height: calc(100vh - 136px); overflow-y: auto; padding-right: 4px; }
.toc-title { margin: 0 0 12px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); }
.toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 7px 0 7px 18px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted-foreground); text-decoration: none; font-size: 14px; line-height: 1.45; }
.toc a:hover { color: var(--foreground); }
.toc a[aria-current='true'] { color: var(--foreground); border-left-color: var(--foreground); }
.toc-mobile { display: none; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 40px; max-width: 960px; }
.card { display: flex; flex-direction: column; gap: 10px; min-height: 168px; padding: 24px; border-radius: 16px; background: var(--muted); text-decoration: none; transition: background .15s; }
.card:hover { background: color-mix(in srgb, var(--muted) 70%, var(--foreground) 8%); }
.card strong { font-size: 19px; font-weight: 600; line-height: 1.3; }
.card span { color: var(--muted-foreground); font-size: 14px; line-height: 1.55; }
.card em { margin-top: auto; font-style: normal; font-size: 13px; }

.foot { border-top: 1px solid var(--border); }
.foot-inner { max-width: 1200px; margin: 0 auto; padding: 28px 24px 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: 13px; color: var(--muted-foreground); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--foreground); }

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .toc-mobile { display: block; margin: 24px 0 0; border: 1px solid var(--border); border-radius: 14px; }
  .toc-mobile summary { cursor: pointer; padding: 14px 18px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; }
  .toc-mobile summary::after { content: '+'; color: var(--muted-foreground); }
  .toc-mobile[open] summary::after { content: '−'; }
  .toc-mobile ol { margin: 0; padding: 0 18px 14px; list-style: none; }
  .toc-mobile a { display: block; padding: 6px 0; color: var(--muted-foreground); text-decoration: none; font-size: 14px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .page { padding: 28px 16px 72px; }
  .bar-inner { padding: 0 16px; }
  .bar-links a:not(.enter) { display: none; }
  .doc .clause { grid-template-columns: minmax(0, 1fr); }
  .doc .clause > .num { display: inline; margin-right: 6px; }
  .doc .clause { display: block; }
  .doc ul { padding-left: 22px; }
  .doc h2 { font-size: 21px; margin-top: 44px; }
}
