/* Full Compass Accountancy Suite: the website's one stylesheet.
   Colours follow the apps' compass mark: navy #1f3a5f, red #c42828, on warm white paper. */

:root {
  color-scheme: light;
  --paper: #faf9f6;
  --surface: #ffffff;
  --sunk: #f2f0eb;
  --ink: #1b2430;
  --muted: #545f6c;
  --line: #e1ddd5;
  --line-strong: #c9c3b8;
  --navy: #1f3a5f;
  --heading: #1f3a5f;
  --link: #1f4a7a;
  --red: #b3262a;
  --button: #1f3a5f;
  --button-hover: #16304f;
  --button-ink: #ffffff;
  --note: #fbf3e2;
  --note-line: #e2c98f;
  --shadow: 0 1px 2px rgba(27, 36, 48, 0.06), 0 8px 24px rgba(27, 36, 48, 0.08);

  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --wide: 1120px;
  --text: 720px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #10151b;
    --surface: #161d25;
    --sunk: #0c1116;
    --ink: #e6eaef;
    --muted: #a3adb9;
    --line: #26303b;
    --line-strong: #3a4654;
    --navy: #1f3a5f;
    --heading: #c9daf0;
    --link: #a9c8ee;
    --red: #e0645f;
    --button: #3d6ea5;
    --button-hover: #4b7cb4;
    --button-ink: #ffffff;
    --note: #241e12;
    --note-line: #6b5527;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  font-feature-settings: "kern", "liga";
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--serif); color: var(--heading); font-weight: 400; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 1.4rem + 3.2vw, 3.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p, ul, ol { margin: 0 0 1em; }
li + li { margin-top: 0.35em; }
strong { font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: 0.88em; }

.skip {
  position: absolute; left: 8px; top: -48px; z-index: 10;
  background: var(--surface); color: var(--link); padding: 8px 14px; border: 1px solid var(--line-strong);
}
.skip:focus { top: 8px; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: var(--text); }

/* Header */

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; min-height: 72px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--heading); margin-right: auto; }
.brand img { width: 36px; height: 36px; }
.brand span { font-family: var(--serif); font-size: 1.25rem; line-height: 1.1; }
.brand small { display: block; font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px 22px; flex-wrap: wrap; align-items: center; }
.site-nav li + li { margin-top: 0; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--line-strong); }
.site-nav a[aria-current="page"] { color: var(--heading); border-bottom-color: var(--red); }
.site-nav .button { padding: 8px 16px; font-size: 0.92rem; border-bottom: 0; color: var(--button-ink); }

/* Buttons */

.button {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--button); color: var(--button-ink); text-decoration: none;
  font-weight: 600; font-size: 1rem; line-height: 1.2;
  padding: 13px 22px; border-radius: 6px; border: 1px solid transparent;
}
.button:hover { background: var(--button-hover); text-decoration: none; }
.button svg { width: 18px; height: 18px; flex: none; }
.button.secondary { background: transparent; color: var(--link); border-color: var(--line-strong); }
.button.secondary:hover { background: var(--surface); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 28px 0 14px; }
.fine { font-size: 0.88rem; color: var(--muted); }

/* Section labels, after the printed page: a number, a rule, a name */

.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 18px;
}
.eyebrow b { color: var(--red); font-weight: 400; }
.eyebrow::after { content: ""; height: 1px; background: var(--line); flex: 1; max-width: 120px; }

section { padding: 72px 0; }
section + section { border-top: 1px solid var(--line); }
.lead { font-size: 1.18rem; color: var(--muted); max-width: 40em; }

/* Home: the opening */

.hero { padding: 64px 0 40px; }
.hero + section { border-top: 0; padding-top: 24px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 0.4em; }

.window {
  margin: 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: var(--shadow); overflow: hidden;
}
.window img { width: 100%; }
.window figcaption { font-size: 0.85rem; color: var(--muted); padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface); }

/* Notices */

.notice {
  background: var(--note); border: 1px solid var(--note-line); border-left: 4px solid var(--note-line);
  border-radius: 6px; padding: 18px 22px; margin: 0 0 1.5em;
}
.notice h2, .notice h3 { font-family: var(--sans); font-size: 1rem; font-weight: 700; color: var(--ink); margin: 0 0 0.35em; }
.notice p:last-child { margin-bottom: 0; }

/* Tags, as small caps labels */

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tags li { margin: 0; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 3px; padding: 2px 7px; }
.tags li.test { color: var(--red); border-color: currentColor; }

/* The six apps */

.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 32px 0 0; padding: 0; list-style: none; }
.app-grid > li { margin: 0; }
.app-card {
  display: grid; grid-template-columns: 56px 1fr; gap: 4px 16px; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px;
  color: inherit; text-decoration: none;
}
a.app-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.app-card img { width: 56px; height: 56px; grid-row: span 3; }
.app-card .kind { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.app-card h3 { font-size: 1.15rem; margin: 0; }
.app-card p { margin: 0; font-size: 0.95rem; color: var(--muted); }

/* Numbered principles */

.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 56px; margin: 36px 0 0; padding: 0; list-style: none; counter-reset: p; }
.principles li { margin: 0; padding-top: 18px; border-top: 1px solid var(--line-strong); counter-increment: p; }
.principles li::before { content: counter(p, decimal-leading-zero); display: block; font-family: var(--mono); font-size: 0.8rem; color: var(--red); margin-bottom: 8px; }
.principles h3 { font-size: 1.2rem; }
.principles p { color: var(--muted); margin: 0; }

/* Steps */

.steps { counter-reset: s; list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 18px; }
.steps > li { counter-increment: s; position: relative; padding-left: 52px; margin: 0; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: -2px;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-family: var(--serif); color: var(--heading); background: var(--surface);
}
.steps h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; color: var(--ink); margin: 0 0 0.2em; }
.steps p { margin: 0; color: var(--muted); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }

/* Apps page */

.lineup { list-style: none; margin: 0; padding: 0; }
.lineup > li { margin: 0; padding: 64px 0; border-top: 1px solid var(--line); }
.lineup > li:first-child { border-top: 0; padding-top: 24px; }
.app-head { display: grid; grid-template-columns: auto 64px 1fr; gap: 18px; align-items: center; margin-bottom: 24px; }
.app-head .num { font-family: var(--mono); color: var(--red); font-size: 0.85rem; align-self: start; padding-top: 6px; }
.app-head img { width: 64px; height: 64px; }
.app-head h2 { margin: 2px 0 2px; }
.app-head .kind { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.app-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.app-body ul { padding-left: 1.1em; }
.app-body .tags { margin-top: 18px; }

/* Download page */

.download-card {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow);
  padding: 32px; display: grid; grid-template-columns: 88px 1fr; gap: 8px 24px; align-items: start;
}
.download-card img { width: 88px; height: 88px; grid-row: span 4; }
.download-card h2 { margin: 0; font-size: 1.6rem; }
.download-card .actions { margin: 16px 0 6px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 10px 0 0; font-size: 0.95rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.hash { font-family: var(--mono); font-size: 0.82rem; overflow-wrap: anywhere; word-break: break-all; }

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 22px 24px; }
.panel h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 700; color: var(--ink); }
.panel p:last-child, .panel ul:last-child { margin-bottom: 0; }

pre {
  background: var(--sunk); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px;
  overflow-x: auto; font-family: var(--mono); font-size: 0.85rem; line-height: 1.5; margin: 0 0 1em;
}

/* Prose pages */

.page-head { padding: 64px 0 24px; }
.page-head .lead { margin-bottom: 0; }
.prose { padding-top: 24px; padding-bottom: 80px; }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.toc { list-style: none; padding: 0; margin: 0 0 2em; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.95rem; }
.toc li + li { margin: 0; }

details { border-top: 1px solid var(--line); padding: 14px 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details > :not(summary) { margin-top: 0.6em; }
details p:last-child { margin-bottom: 0; }

/* What's new */

.releases { list-style: none; padding: 0; margin: 0; }
.releases > li { margin: 0; padding: 22px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 56px 1fr; gap: 4px 18px; }
.releases > li:last-child { border-bottom: 1px solid var(--line); }
.releases img { width: 48px; height: 48px; grid-row: span 2; }
.releases h3 { font-size: 1.15rem; margin: 0; }
.releases .ver { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); margin-left: 8px; }
.releases p { margin: 0; }

/* Footer */

.site-footer { border-top: 1px solid var(--line); background: var(--sunk); padding: 40px 0 48px; font-size: 0.92rem; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; }
.site-footer p { margin: 0 0 0.6em; max-width: 46em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: flex-end; align-content: start; }
.site-footer li + li { margin: 0; }
.site-footer .brand { margin-bottom: 12px; }
.site-footer .brand img { width: 28px; height: 28px; }

/* Narrower screens */

@media (max-width: 900px) {
  .hero .wrap, .app-body, .two { grid-template-columns: 1fr; gap: 36px; }
  .app-grid, .three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .site-footer ul { justify-content: flex-start; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  section { padding: 52px 0; }
  .hero { padding: 40px 0 52px; }
  .site-header .wrap { gap: 10px 20px; padding-top: 12px; padding-bottom: 10px; }
  .site-nav { width: 100%; }
  .site-nav ul { gap: 4px 18px; }
  .site-nav .nav-download { margin-left: auto; }
  .app-grid, .three, .principles { grid-template-columns: 1fr; }
  .app-head { grid-template-columns: 48px 1fr; }
  .app-head .num { display: none; }
  .app-head img { width: 48px; height: 48px; }
  .download-card { grid-template-columns: 1fr; padding: 22px; }
  .download-card img { width: 64px; height: 64px; grid-row: auto; }
  dl.facts { grid-template-columns: 1fr; gap: 0; }
  dl.facts dd { margin-bottom: 8px; }
  .releases > li { grid-template-columns: 40px 1fr; }
  .releases img { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: no-preference) {
  a.app-card, .button { transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease; }
}

@media print {
  .site-header nav, .site-footer ul, .actions { display: none; }
  body { background: #fff; color: #000; }
}

/* Spacing helpers */
.mt-s { margin-top: 14px; }
.mt { margin-top: 24px; }
.window a.zoom { display: block; cursor: zoom-in; }
.site-nav .button[aria-current="page"] { color: var(--button-ink); border-bottom: 0; box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--red); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.notice + .eyebrow { margin-top: 56px; }
.prose .steps h3, .prose .notice h3, .prose .panel h3 { margin-top: 0; }
@media (max-width: 640px) {
  h1 { font-size: 2.15rem; }
  .lead { font-size: 1.08rem; }
}
@media (prefers-color-scheme: dark) {
  .window img { filter: brightness(0.92); }
}
.app-body ul:not(.tags) { list-style: disc; }
.app-body ul.tags { padding-left: 0; }
