
:root {
  color-scheme: light;

  --ground:    #f7f6f4;
  --raised:    #fffefd;

  --ink-strong:#2b2b2b;
  --ink:       #4c4c4c;
  --ink-soft:  #6e6c69;
  --ink-faint: #918e8a;

  --rule:      #dedbd6;
  --rule-soft: #eceae6;

  --a-1:  #d24d06;  --a-2:  #8f4319;  --a-3:  #803c18;
  --c-1:  #33c8ff;  --c-2:  #0b6d92;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --t-2xs: .70rem;  --t-xs:  .74rem;  --t-sm:  .82rem;  --t-md:  1rem;  --t-lg:  1.12rem;  --t-xl:  1.85rem;
  --lh-head: 1.25;
  --lh-body: 1.62;

  --s1: .35rem; --s2: .6rem;  --s3: 1rem;   --s4: 1.6rem;
  --s5: 2.4rem; --s6: 3.6rem; --s7: 5.5rem;

  --gap-mark: 115px;  --gap-hero: 95px;  --gap-para: 40px;
  --measure: 40rem;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
  line-height: var(--lh-body);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: var(--s6) var(--s4) var(--s7); }
@media (max-width: 640px) { .wrap { padding: var(--s5) var(--s3) var(--s6); } }

a { color: var(--a-2); text-decoration: underline; text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--a-1); }
a:focus-visible { outline: 2px solid var(--a-2); outline-offset: 3px; }

h1, h2 { color: var(--ink-strong); font-weight: 700; line-height: var(--lh-head);
         text-wrap: balance; margin: 0; }
h1 { font-size: var(--t-xl); letter-spacing: -.02em; }
h2 { font-size: var(--t-lg); letter-spacing: -.01em; }
p, ul, ol { margin: 0; }

.eyebrow {
  font-size: var(--t-2xs); font-weight: 500; letter-spacing: .13em;
  text-transform: uppercase; color: var(--a-2);
}

.wordmark {
  display: inline-block; align-self: flex-start;
  font-size: var(--t-lg); font-weight: 700; letter-spacing: -.01em;
  color: var(--ink-strong);
  line-height: 1.05;
  border-bottom: 2px solid var(--a-2);
  padding-bottom: .04em;
}
a.wordmark { color: var(--ink-strong); text-decoration: none; }
a.wordmark:hover { border-bottom-color: var(--a-1); }

.val { color: var(--c-2); font-variant-numeric: tabular-nums; font-weight: 500; }

section { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5) 0; }
section + section { border-top: 1px solid var(--rule-soft); }
.sechead { display: flex; flex-direction: column; gap: var(--s1); }

.door { display: flex; flex-direction: column; }

.topline { display: flex; justify-content: space-between; align-items: baseline;
           gap: var(--s4); margin-bottom: var(--gap-mark); }
.topline .wordmark { margin-bottom: 0; }
.topnav, .topnav a, .topnav .here {
  display: inline-block;
  font-size: var(--t-lg); font-weight: 700; letter-spacing: -.01em;
  line-height: 1.05;
  color: var(--ink-strong); text-decoration: none;
  border-bottom: 2px solid var(--a-2);
  padding-bottom: .04em;
}
.topnav a, .topnav .here { border-bottom: 0; padding-bottom: 0; }
.topnav:hover { border-bottom-color: var(--a-1); }
.topnav:has(.here):hover { border-bottom-color: var(--a-2); }
.door > h1 + p   { margin-top: var(--s3); }
.door .statement { display: flex; flex-direction: column; gap: var(--s3);
                   margin-bottom: var(--gap-hero); }
.door .prose {
  display: flex; flex-direction: column; gap: var(--gap-para);
  padding-left: 2ch;
}
.door p { font-size: 1.06rem; }

.door p.recompute { font-size: 1rem; }

.run-in { color: var(--a-2); font-weight: 600; }

.soft { color: var(--ink-soft); font-size: var(--t-md); }

.lede { color: var(--ink); font-size: var(--t-md); }

.intro { color: var(--ink); font-size: 1.06rem; margin-top: 10px; }
.door .lede { font-size: 1.06rem; }

.door .soft { margin-top: 10px; }
.small { color: var(--ink-soft); font-size: var(--t-sm); }

.cases { display: flex; flex-direction: column; }
.case {
  display: flex; flex-direction: column; gap: var(--s1);
  padding: var(--s3) 0; border-top: 1px solid var(--rule-soft);
}
.case:last-child { border-bottom: 1px solid var(--rule-soft); }
.case .q { font-weight: 600; }

.cases { padding-left: 2ch; }

.limits { gap: 0; }
.limits .disclosure {
  color: var(--a-2);
  font-size: var(--t-sm);
  line-height: var(--lh-body);
}
.case .d { font-size: var(--t-sm); color: var(--ink-soft); }

.record .case { gap: var(--s2); }
.record .case .q { color: var(--ink-strong); }

.steps { list-style: none; margin: 0; padding: 0;
         display: flex; flex-direction: column; }
.step  { display: flex; flex-direction: column; gap: var(--s3);
         padding: var(--s5) 0; border-top: 1px solid var(--rule-soft); }
.step-n { font-size: var(--t-2xs); font-weight: 500; letter-spacing: .13em;
          text-transform: uppercase; color: var(--a-2); }

.defs { margin: 0; }
.defs dt { font-weight: 600; color: var(--ink-strong); }
.defs dd { margin: 0 0 var(--s3); color: var(--ink); font-size: var(--t-sm); }
.defs dd:last-child { margin-bottom: 0; }

.inset {
  border-left: 3px solid var(--a-1);
  background: var(--raised);
  padding: var(--s3) var(--s4);
  display: flex; flex-direction: column; gap: var(--s3);
}
.inset .stamp {
  font-size: var(--t-2xs); letter-spacing: .1em; text-transform: uppercase;
  color: var(--a-2); font-weight: 600;
}
.inset pre {
  margin: 0; overflow-x: auto;
  font-size: var(--t-sm); line-height: 1.5; color: var(--ink);
}
.inset code { font: inherit; }

code { font-size: .92em; }

footer {
  margin-top: var(--s5); padding-top: var(--s3);
  border-top: 1px solid var(--rule);
  font-size: var(--t-xs); color: var(--ink-faint);
  display: flex; flex-direction: column; gap: var(--s1);
}
footer a { color: var(--ink-soft); }

footer .enq { color: var(--ink-soft); }
footer .enq a { color: var(--a-2); }

.sheet h1 { font-size: 1.5rem; margin-bottom: var(--s3); }
.sheet-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--s4); padding-bottom: var(--s3);
  border-bottom: 2px solid var(--a-2); margin-bottom: var(--s5);
}
.sheet-mark .wordmark { margin-bottom: 0; }
.sheet-meta { text-align: right; font-size: var(--t-xs); color: var(--ink-soft);
              display: flex; flex-direction: column; gap: 2px; }
.clause { padding: var(--s4) 0 0; display: flex; flex-direction: column; gap: var(--s3); }
.clause h2 { font-size: var(--t-lg); }
.clause p { font-size: var(--t-md); }
.sheet-foot { margin-top: var(--s6); padding-top: var(--s3);
              border-top: 2px solid var(--a-2);
              display: flex; flex-direction: column; gap: var(--s3);
              font-size: var(--t-xs); color: var(--ink-soft); }
.sheet-sig { display: flex; align-items: center; gap: var(--s3); }
.fdn-mark { flex: 0 0 auto; }
.sheet-sig-name { font-size: var(--t-md); font-weight: 600; color: var(--ink-strong); }
.sheet-fine { display: flex; flex-direction: column; gap: 2px; }

@media print {
  .no-print { display: none; }
  body { font-size: 10.5pt; background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .clause { break-inside: avoid; }
  a { color: var(--ink); text-decoration: none; }
}

.topline:has(.menu) { align-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; padding: .4rem 0 .4rem .6rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:focus-visible { outline: 2px solid var(--a-2); outline-offset: 3px; }
.menu-lines { display: inline-flex; flex-direction: column; gap: 7px; width: 1.75rem; }
.menu-lines i { display: block; height: 2px; background: var(--ink-strong); }
.menu summary:hover .menu-lines i { background: var(--a-1); }
.menu[open] .menu-lines i { background: var(--a-2); }
.menu-drop { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 10; display: flex; align-items: baseline; gap: .7rem;
             white-space: nowrap; padding: .65rem 1rem; background: var(--raised); border: 1px solid var(--rule);
             font-size: var(--t-md); font-weight: 600; }
.menu-drop a { color: var(--ink-strong); }
.menu-drop .here { color: var(--ink-soft); }
.menu-drop .sep { color: var(--ink-faint); font-weight: 400; }
