@font-face {
  font-family: 'Atkinson Next';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/assets/fonts/ahn-latin.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Atkinson Next';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('/assets/fonts/ahn-latin-italic.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Atkinson Mono';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/assets/fonts/ahm-latin.woff2') format('woff2-variations');
}

:root {
  --bg: #fafaf8;
  --paper: #ffffff;
  --ink: #111318;
  --muted: #4b525c;
  --rule: #d8dad4;
  --accent: #0f766e;
  --accent-soft: #e6f2f0;
  --warn-bg: #fbf6e8;
  --warn-border: #b7791f;
  --sans: 'Atkinson Next', system-ui, -apple-system, sans-serif;
  --mono: 'Atkinson Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.58;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #9aa0a8;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

code,
pre,
time,
.mono {
  font-family: var(--mono);
  font-size: 0.87em;
}

code {
  background: #eff0ec;
  padding: 0.08em 0.32em;
  border-radius: 3px;
}

pre {
  background: #f1f2ee;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  line-height: 1.48;
  margin: 0.9rem 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.95em;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.45rem 0.8rem;
  text-decoration: none;
  z-index: 20;
}

.skip:focus {
  left: 0.5rem;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding-inline: 1.5rem;
}

/* Header: 64px on desktop, wraps cleanly on narrow screens. */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.site-header .bar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  flex-wrap: wrap;
  padding-block: 0.5rem;
}

.mark {
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

.site-header nav a {
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--muted);
  padding-block: 0.2rem;
}

.site-header nav a:hover,
.site-header nav a[aria-current='page'] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.32em;
}

/* Page head: capped at 680px per spec. */
.page-head {
  padding-top: 3.4rem;
  padding-bottom: 2.4rem;
}

.page-head > * {
  max-width: 680px;
}

.page-head .record-frame {
  max-width: none;
}

.pill {
  display: inline-block;
  margin: 0 0 1.1rem;
  padding: 0.22rem 0.62rem;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 3px;
}

h1 {
  font-size: clamp(1.85rem, 3.3vw, 2.55rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.lede {
  font-size: 1.08rem;
  color: var(--muted);
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.4rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  padding: 0.55rem 1.05rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
}

.button:hover {
  background: #0b5d56;
  border-color: #0b5d56;
  color: #ffffff;
}

.button-quiet {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--rule);
}

.button-quiet:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
}

/* Signature element: the company register card on the home page. */
.record-frame {
  margin-top: 2.4rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
}

.record-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

.record-head strong {
  color: var(--ink);
  font-weight: 600;
}

.record {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(9rem, 12.5rem) 1fr auto;
}

.record > div {
  display: contents;
}

.record dt,
.record dd {
  margin: 0;
  padding: 0.68rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.94rem;
}

.record > div:last-child dt,
.record > div:last-child dd {
  border-bottom: 0;
}

.record dt {
  color: var(--muted);
}

.record dd.src {
  text-align: right;
  white-space: nowrap;
  font-size: 0.86rem;
}

/* Two-column ruled sections: 220px heading rail, 680px reading column. */
.row {
  display: grid;
  grid-template-columns: 220px minmax(0, 680px);
  gap: 1.25rem 3rem;
  padding-block: 2.3rem;
  border-top: 1px solid var(--rule);
}

.row > h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 1.8rem 0 0.45rem;
}

.prose h3:first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.3rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.88rem;
}

/* Notices: report note, scope boundary, exact policy text. */
.notice {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 0.95rem 1.15rem;
  margin: 1.1rem 0;
}

.notice-warn {
  background: var(--warn-bg);
  border-color: #e4d4ad;
  border-left-color: var(--warn-border);
}

.notice > :first-child {
  margin-top: 0;
}

.notice > :last-child {
  margin-bottom: 0;
}

/* Service and finding specs: compact key-value pairs inside a section. */
.kv {
  margin: 0.75rem 0 0;
  border-top: 1px solid var(--rule);
}

.kv > div {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0.25rem 1rem;
  padding-block: 0.55rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.94rem;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
}

/* Tables: dated proof table, research index, report summary. */
.table-scroll {
  overflow-x: auto;
  margin: 0.5rem 0 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

th {
  font-weight: 600;
  color: var(--muted);
  border-bottom-color: var(--ink);
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 3px;
  white-space: nowrap;
}

.tag-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
}

/* Numbered sequences: used only where the content really is ordered steps. */
.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.4rem;
  margin-bottom: 1.25rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.12rem;
  width: 1.6rem;
  height: 1.6rem;
  line-height: 1.52rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 3px;
}

/* Checklist: 220px sticky desktop index per spec, static text works without JS. */
.checklist-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 680px);
  gap: 2rem 3rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
  align-items: start;
}

.checklist-index {
  position: sticky;
  top: 1.25rem;
  font-size: 0.86rem;
}

.checklist-index h2 {
  font-size: 0.86rem;
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-weight: 600;
}

.checklist-index ol {
  margin: 0;
  padding-left: 1.35rem;
}

.checklist-index li {
  margin-bottom: 0.38rem;
  line-height: 1.35;
}

.checklist-index a {
  text-decoration: none;
  color: var(--muted);
}

.checklist-index a:hover {
  color: var(--accent);
}

.checklist-index li[data-state='pass'] a {
  color: var(--accent);
}

.checklist-index li[data-state='fail'] a {
  color: #9b2c2c;
  font-weight: 600;
}

.checklist-tools {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.8rem 1rem;
  margin-bottom: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  font-size: 0.88rem;
}

.checklist-tools .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checklist-tools button,
.copy-btn {
  font-family: var(--sans);
  font-size: 0.82rem;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
}

.checklist-tools button:hover,
.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.check-item {
  padding-bottom: 2.2rem;
  margin-bottom: 2.2rem;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 1.25rem;
}

.check-item:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.check-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.check-head h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.check-num {
  font-family: var(--mono);
  color: var(--muted);
  margin-right: 0.35rem;
}

.state-picker {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: var(--paper);
  margin: 0;
  padding: 0;
}

.state-picker label {
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  color: var(--muted);
  border-right: 1px solid var(--rule);
  user-select: none;
}

.state-picker label:last-child {
  border-right: 0;
}

.state-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.state-picker label:has(input:checked) {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.state-picker label:has(input[value='fail']:checked) {
  background: #9b2c2c;
}

.state-picker label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.code-wrap {
  position: relative;
}

.code-wrap .copy-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  background: var(--paper);
}

/* Sample report findings. */
.finding {
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.finding:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

/* Footer: statutory UK company particulars on every page. */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--rule);
  padding-block: 2rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.site-footer .legal {
  margin: 0 0 0.75rem;
  max-width: 78ch;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

@media (max-width: 860px) {
  .row,
  .checklist-shell {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .checklist-index {
    position: static;
    background: var(--paper);
    border: 1px solid var(--rule);
    padding: 0.9rem 1.1rem;
  }

  .record {
    grid-template-columns: 1fr;
  }

  .record dt {
    padding-bottom: 0.1rem;
    border-bottom: 0;
  }

  .record dd {
    padding-top: 0;
  }

  .record dd:not(.src) {
    border-bottom: 0;
    padding-bottom: 0.15rem;
  }

  .record dd.src {
    text-align: left;
    padding-bottom: 0.75rem;
  }

  .kv > div {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  .site-header nav,
  .checklist-tools,
  .checklist-index,
  .state-picker,
  .copy-btn,
  .actions {
    display: none !important;
  }

  html {
    font-size: 11pt;
    background: #ffffff;
  }

  .row {
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    padding-block: 1rem;
  }
}
