/* MoonCycle legal pages. Tokens: UI-SPEC.md (MoonCycle Plum palette). Fonts self-hosted, no third-party requests. */
@font-face { font-family: "Jost"; src: url("/fonts/jost_variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Philosopher"; src: url("/fonts/philosopher_regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Philosopher"; src: url("/fonts/philosopher_bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ground: #F8F4F1;
  --surface: #FFFDFB;
  --ink: #1A1220;
  --muted: #4A3F50;
  --faint: #6B5F70;
  --hair: rgba(26, 18, 32, 0.11);
  --accent: #97556B;
  --display: "Philosopher", Georgia, serif;
  --text: "Jost", "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
  --measure: 66ch;
  --body: 18px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #15101C;
    --surface: #211A27;
    --ink: #F3EDE0;
    --muted: #CBC1CF;
    --faint: #A79CAC;
    --hair: rgba(236, 224, 240, 0.12);
    --accent: #E7B3BE;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 var(--body)/1.65 var(--text); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 6px 10px; z-index: 2; }

/* header: wordmark left, the five pages right */
header.site { display: flex; align-items: baseline; gap: 12px 40px; flex-wrap: wrap; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; padding: 28px 40px 24px; border-bottom: 1px solid var(--hair); }
.mark { font: 700 28px/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: 0; }
header.site nav { display: flex; flex-wrap: wrap; gap: 6px 28px; font-size: 16px; }
header.site nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
header.site nav a:hover { color: var(--ink); }
header.site nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }

/* frame: sticky contents column beside the reading column */
.frame { max-width: 1200px; margin: 0 auto; padding: 56px 40px 96px; display: grid; gap: 64px;
  grid-template-columns: 15rem minmax(0, 1fr); }
.no-toc .frame { grid-template-columns: minmax(0, 1fr); padding-left: calc(40px + 15rem + 64px); }
main { padding-left: 3.5rem; min-width: 0; overflow-wrap: break-word; }
main > * { max-width: var(--measure); }
main > .table { max-width: none; }

.toc-side { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto;
  font-size: 14px; line-height: 1.45; padding-right: 8px; }
.toc-head, .toc-inline summary { font: 700 16px/1.3 var(--display); color: var(--ink); margin: 0 0 14px; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 0 0 7px; }
.toc-list li.l3 { padding-left: 2.3em; font-size: 14px; }
.toc-list a { color: var(--muted); text-decoration: none; display: grid; grid-template-columns: 2.3em 1fr; }
.toc-list li.l3 a { grid-template-columns: 2.6em 1fr; }
.toc-list a.plain { display: block; }
.toc-list a:hover { color: var(--ink); }
.toc-list .tn { color: var(--accent); font-family: var(--display); }
.toc-inline { display: none; }

/* type scale, ratio 1.25 */
h1 { font: 700 44px/1.12 var(--display); margin: 0 0 18px; letter-spacing: 0; color: var(--ink); }
h2 { font: 700 28px/1.25 var(--display); margin: 2.4em 0 0.6em; position: relative; color: var(--ink); }
h3 { font: 700 22.5px/1.3 var(--display); margin: 1.9em 0 0.5em; position: relative; color: var(--ink); }
h2 .num, h3 .num { position: absolute; right: calc(100% + 0.7rem); top: 0; text-decoration: none;
  color: var(--accent); font-weight: 400; white-space: nowrap; }
h2 .num:hover, h3 .num:hover { text-decoration: underline; }
h2 .self, h3 .self, p .self { color: inherit; text-decoration: none; }
p, ul, ol, address, .table { margin: 0 0 1em; }
.eff { color: var(--muted); font-size: 16px; }
ul, ol { padding-left: 1.4em; }
li { margin: 0 0 0.4em; }
li > ul, li > ol { margin-top: 0.4em; }
strong { font-weight: 600; }
code { font-size: 0.92em; }
address { font-style: normal; }
.lede { font-size: 22.5px; line-height: 1.5; }
.doc-list { list-style: none; padding: 0; font-size: 22.5px; line-height: 1.4; }
.doc-list li { padding: 14px 0; border-top: 1px solid var(--hair); margin: 0; }
.doc-list li:last-child { border-bottom: 1px solid var(--hair); }
.doc-list a { font-family: var(--display); text-decoration: none; }
.doc-list a:hover { text-decoration: underline; }

/* tables: hairline rows, wider than the measure on desktop */
.table { overflow-x: auto; margin: 1.4em 0 1.6em; }
table { border-collapse: collapse; width: 100%; font-size: 16px; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--hair); }
th { font-weight: 600; color: var(--muted); border-bottom-color: var(--ink); }

footer.site { max-width: 1200px; margin: 0 auto; padding: 24px 40px 40px; border-top: 1px solid var(--hair);
  font-size: 14px; color: var(--faint); }
footer.site p { margin: 0; }

@media (max-width: 1023px) {
  .frame, .no-toc .frame { grid-template-columns: minmax(0, 1fr); padding: 40px 32px 72px; gap: 0; }
  .toc-side { display: none; }
  .toc-inline { display: block; margin: 0 0 28px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 12px 0; }
  .toc-inline summary { cursor: pointer; margin: 0; }
  .toc-inline[open] summary { margin-bottom: 14px; }
  .toc-inline .toc-list { font-size: 15px; }
  main { padding-left: 0; }
  h2 .num, h3 .num { position: static; margin-right: 0.35em; }
}
@media (max-width: 600px) {
  :root { --body: 17px; }
  body { line-height: 1.6; }
  header.site { padding: 20px 16px 16px; gap: 10px; }
  .mark { font-size: 24px; }
  header.site nav { gap: 2px 18px; font-size: 15px; }
  .frame, .no-toc .frame { padding: 28px 16px 56px; }
  h1 { font-size: 35px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }
  .lede, .doc-list { font-size: 20px; }
  footer.site { padding: 20px 16px 32px; }
  /* a table becomes labelled stacked rows instead of scrolling sideways */
  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; left: -9999px; }
  tr { border-top: 1px solid var(--ink); padding: 8px 0 4px; }
  td { border: 0; padding: 4px 0; }
  td::before { content: attr(data-label); display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
}

@media print {
  :root { --ground: #FFFFFF; --ink: #000000; --muted: #333333; --faint: #555555; --accent: #000000; --hair: #BBBBBB; --body: 11pt; }
  body { background: #FFFFFF; color: #000000; line-height: 1.45; }
  header.site nav, .toc-side, .toc-inline, .skip { display: none !important; }
  header.site, footer.site, .frame { padding: 0; max-width: none; border: 0; display: block; }
  @page { margin: 18mm 16mm; }
  main { padding: 0; }
  main > * { max-width: none; }
  header.site { margin-bottom: 10pt; }
  .mark { font-size: 12pt; }
  h1 { font-size: 22pt; }
  h2 { font-size: 15pt; break-after: avoid; }
  h3 { font-size: 12.5pt; break-after: avoid; }
  h2 .num, h3 .num { position: static; margin-right: 0.3em; }
  a { color: #000000; text-decoration: none; }
  tr, li, p { break-inside: avoid; }
  footer.site { margin-top: 24pt; border-top: 1px solid #BBBBBB; padding-top: 6pt; }
}
