/* Access Proof. Direction A, "The Focus Ring" (provisional until gate G1).
   Tokens and contrast ratios are recorded in docs/design-directions.md and
   re-checked by tests/contrast.test.mjs. */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fafafa;
  --panel: #f0f0f0;
  --ink: #1a1a1a;
  --quiet: #555555;
  --edge: #8c8c8c;
  --rule: #d4d4d4;
  --focus: #3a2ee6;
  --on-focus: #ffffff;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step-0: 1.125rem;
  --step-1: 1.40625rem;
  --step-2: 1.75rem;
  --step-3: 2.1875rem;
  --step-5: 3.4375rem;

  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --measure: 40rem;
  --rail: 11rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0) / 1.6 var(--sans);
  overflow-wrap: break-word;
}

/* Links and focus. The focus ring is the identity of the page: thick, accent
   coloured, offset, with a paper halo so it stays crisp on any surface. */

a {
  color: var(--focus);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-thickness: 0.16em;
}

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--paper);
}

/* Layout */

.wrap {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

.wordmark {
  color: var(--ink);
  font: 500 var(--step-1) / 1 var(--serif);
  text-decoration: none;
}

.wordmark:hover {
  text-decoration: underline;
}

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

.site-nav a {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
}

.site-nav a[aria-current="page"] {
  text-decoration-thickness: 0.16em;
}

/* Type */

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  max-width: 20ch;
  font-size: clamp(2.5rem, 8vw, var(--step-5));
  letter-spacing: -0.012em;
}

h2 {
  font-size: var(--step-2);
}

h3 {
  font-size: var(--step-1);
}

p,
ul,
ol {
  margin: 0 0 1em;
}

p:last-child,
ul:last-child,
ol:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
}

/* Hero */

.hero {
  padding: clamp(2.5rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.lede {
  max-width: 36rem;
  margin: 1.75rem 0 2.25rem;
  font-size: 1.25rem;
  line-height: 1.55;
}

.button {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  border: 2px solid transparent; /* stays visible in forced-colours mode */
  border-radius: 2px;
  background: var(--focus);
  color: var(--on-focus);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.2em;
}

.demo {
  max-width: var(--measure);
  margin-top: 3.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
}

.demo p {
  font-family: var(--serif);
  font-size: var(--step-1);
  line-height: 1.35;
}

/* Sections: heading in the left rail, text at reading width */

.block {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, var(--measure));
  gap: 1rem 3rem;
  padding: clamp(2.25rem, 5vw, 3.5rem) 0;
  border-top: 1px solid var(--rule);
}

.block > * {
  min-width: 0;
}

.block > h2 {
  grid-column: 1;
}

.block > :not(h2) {
  grid-column: 2;
}

.list-spaced li {
  margin-bottom: 0.9em;
}

.steps {
  padding-left: 1.5rem;
}

.steps li {
  padding-left: 0.4rem;
  margin-bottom: 0.75em;
}

.steps li::marker {
  color: var(--ink);
  font: 500 var(--step-1) var(--serif);
}

.bullets {
  padding-left: 1.25rem;
}

.bullets li {
  padding-left: 0.25rem;
}

.note {
  color: var(--quiet);
  font-size: 1rem;
}

/* Pricing table */

.price-table {
  width: 100%;
  border-collapse: collapse;
}

.price-table caption {
  padding-bottom: 0.75rem;
  color: var(--quiet);
  font-size: 1rem;
  text-align: left;
}

.price-table th,
.price-table td {
  padding: 0.85rem 1rem 0.85rem 0;
  border-bottom: 1px solid var(--edge);
  text-align: left;
  vertical-align: baseline;
}

.price-table thead th {
  border-bottom-width: 2px;
  border-bottom-color: var(--ink);
  color: var(--quiet);
  font-size: 1rem;
  font-weight: 600;
}

.price-table tbody th {
  font-weight: 400;
}

.price-table td {
  padding-right: 0;
  font-family: var(--serif);
  font-size: var(--step-1);
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
  white-space: nowrap;
}

.price-table thead th:last-child {
  padding-right: 0;
  text-align: right;
}

/* Contact */

.contact-link {
  font: 500 clamp(1.5rem, 5vw, var(--step-3)) / 1.2 var(--serif);
  overflow-wrap: anywhere;
}

/* Footer */

.site-footer {
  margin-top: 1rem;
  padding: 2.5rem 0 3rem;
  background: var(--panel);
  color: var(--ink);
  font-size: 1rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.site-footer .legal {
  max-width: var(--measure);
  color: var(--quiet);
}

/* Prose pages (accessibility statement) */

.prose {
  max-width: var(--measure);
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.prose h1 {
  max-width: none;
  margin-bottom: 1.5rem;
  font-size: clamp(2.1rem, 6vw, 2.75rem);
}

.prose h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: var(--step-1);
}

.todo {
  padding: 0.1em 0.35em;
  border: 1px dashed var(--edge);
  background: var(--panel);
  color: var(--ink);
}

/* Narrow screens: one column, no rail */

@media (max-width: 48rem) {
  .block {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .block > h2,
  .block > :not(h2) {
    grid-column: 1;
  }

  .hero {
    padding-top: 1.5rem;
  }
}

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

@media print {
  body {
    background: #fff;
    font-size: 12pt;
  }

  .skip-link,
  .demo {
    display: none;
  }

  a {
    color: inherit;
  }
}
