:root {
  --fg: #202020; --bg: #fff; --link: #174b70; --muted: #595959;
  --rule: #bdbdbd; --rule-strong: #949494;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark; font-family: var(--serif); color: var(--fg); background: var(--bg);
}
* { box-sizing: border-box; }
body { max-width: 40rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; font-size: 1.125rem; line-height: 1.65; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
main:focus { outline: none; }

/* Header */
header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1.5rem; border-bottom: 1px solid var(--rule); padding-bottom: .85rem; margin-bottom: 2.75rem; font-family: var(--sans); }
.brand { margin: 0 auto 0 0; font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; }
.brand a { color: inherit; text-decoration: none; }
.brand a:hover, .brand a:focus-visible { text-decoration: underline; }
header nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; font-size: .95rem; }
header nav a { display: inline-block; padding: .5rem 0; }
header nav a[aria-current="page"] { color: inherit; font-weight: 600; text-decoration: none; }

/* Text */
h1, h2 { line-height: 1.25; }
h1 { font-size: 2rem; margin: 0 0 1.25rem; font-weight: normal; }
h2 { font-size: 1.5rem; margin: 3rem 0 .6rem; }
main h2[id] { scroll-margin-top: 1rem; }
p { margin: 0 0 1.35rem; }
li { margin-bottom: .5rem; }
ul { padding-left: 1.4rem; margin: 0 0 1.35rem; }
address { font-style: normal; margin: 0 0 1.35rem; }
.note { font-family: var(--sans); font-size: .95rem; color: var(--muted); }
.note a { color: var(--link); }

/* Contents list on long statements */
.toc { font-family: var(--sans); font-size: .95rem; margin: 1.75rem 0 2.75rem; }
.toc h2 { font-size: .85rem; margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .06em; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0 0 .15rem; line-height: 1.35; }
.toc a { display: inline-block; padding: .2rem 0; }
@media (min-width: 34rem) { .toc ul { columns: 2; column-gap: 2rem; } }

/* Home page */
.cta { margin: 1.75rem 0 2.5rem; }
.cta a { display: inline-block; font-family: var(--sans); font-size: 1.05rem; font-weight: 600; text-decoration: none; color: var(--bg); background: var(--link); padding: .65rem 1.4rem; border-radius: 4px; }
.cta a:hover { background: var(--fg); }
.hero { margin: 0 0 2.5rem; }
.hero img { display: block; width: 100%; height: auto; }

/* Table */
table { font-family: var(--sans); width: 100%; max-width: 26rem; border-collapse: collapse; margin: 1.75rem 0; font-size: .95rem; }
caption { text-align: left; font-weight: 600; line-height: 1.35; padding-bottom: .5rem; }
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--rule-strong); }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; text-align: right; }
thead th { border-bottom-width: 2px; }
th[scope="row"] { font-weight: normal; }

/* Footer */
footer { font-family: var(--sans); border-top: 1px solid var(--rule); margin-top: 3.5rem; padding-top: 1rem; font-size: .95rem; }
footer nav a, footer p a { display: inline-block; padding: .25rem 0; }
footer nav, footer p { margin: 0 0 .4rem; }

/* Skip link */
.skip { position: absolute; left: -10000px; top: .4rem; }
.skip:focus { left: 1.25rem; z-index: 1; font-family: var(--sans); font-size: 1rem; background: var(--bg); color: var(--link); padding: .5rem .9rem; border: 2px solid var(--link); border-radius: 4px; outline-offset: 2px; }

@media (prefers-color-scheme: dark) {
  :root { --fg: #dcdcdc; --bg: #141414; --link: #8fc1e3; --muted: #a6a6a6; --rule: #4a4a4a; --rule-strong: #6b6b6b; }
  .hero img { filter: invert(1) hue-rotate(180deg); }
}

@page { margin: 0.9in 1in; }
@media print {
  :root { --fg: #000; --bg: #fff; --link: #000; --muted: #333; --rule: #999; --rule-strong: #666; color-scheme: light; }
  body { max-width: none; padding: 0; font-size: 11pt; }
  .skip, header nav, footer nav, .toc { display: none; }
  header { border-bottom: 0; margin-bottom: 1.5rem; padding-bottom: 0; }
  .brand { font-size: 1rem; }
  .brand a::after { content: " · cleanpage.org"; font-weight: normal; }
  .cta a { background: none; color: inherit; padding: 0; text-decoration: underline; }
  .hero img { filter: none; }
  a { color: inherit; }
  h1, h2 { break-after: avoid; }
  li, tr { break-inside: avoid; }
}
