/*
 * The shell every page shares: reset, typography, masthead, footer.
 *
 * Nothing here has a border-radius, a box-shadow or a background panel. The
 * structural vocabulary is a hairline rule and a lot of space, which is what
 * separates a typeset page from an interface.
 */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.1875rem;
  line-height: 1.65;
  /* Both faces ship the weights and styles they are asked for, so a
     browser must never manufacture a bold or an oblique — a synthesised
     slant on Public Sans, which is loaded roman-only, is the visible
     failure this prevents. */
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  /* Source Serif 4's optical-size axis. Left to the browser, which sets it
     from the computed font-size — so the 70px titles and the 19px body are
     drawn differently rather than being one shape scaled twice. */
  font-optical-sizing: auto;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1.15em;
  text-wrap: pretty;
}

/*
 * Body links: ink, underlined, the way a printed document does it. A page of
 * blue links is the strongest "app" signal left once the boxes are gone, so
 * colour is reserved for hover and the accent is used almost nowhere else.
 */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--rule);
  transition:
    text-decoration-color 120ms ease,
    color 120ms ease;
}

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

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

strong {
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 6vw, 4rem);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  z-index: 10;
}

.skip:focus {
  left: 0;
}

/* -------------------------------------------------------------- masthead */

/*
 * A masthead, not an app bar. It shares the page's paper — no panel colour,
 * no shadow, no sticky behaviour — and is separated from the page by a single
 * rule. The nav sets in small caps rather than sentence case, which is what
 * stops five links in a row reading as tabs.
 */
.masthead {
  border-bottom: 1px solid var(--rule);
}

.masthead .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25rem 2.5rem;
  flex-wrap: wrap;
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.4375rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  text-decoration: none;
  color: var(--ink);
}

.wordmark:hover {
  color: var(--ink);
}

.wordmark svg {
  color: var(--accent);
  flex: none;
  /* Sized here rather than by the `width` attribute in `mark.njk`, and in `em`
     so the mark tracks the name beside it. The attribute stays as the
     intrinsic size for anything that reads the file on its own. */
  width: 1.3em;
  height: 1.3em;
  /* Optically aligned to the wordmark's baseline rather than its box. The
     mark is bottom-heavy — a solid hull under a smaller circle — so its
     visual centre sits below its geometric one. */
  transform: translateY(-0.04em);
}

.masthead-nav {
  display: flex;
  gap: clamp(1.1rem, 3.5vw, 2.25rem);
  flex-wrap: wrap;
}

.masthead-nav a {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
}

.masthead-nav a:hover {
  color: var(--accent);
}

/* The current page is marked by ink weight and a rule set well clear of the
   text — not a tab underline sitting against it. */
.masthead-nav a[aria-current='page'] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.5em;
}

main {
  flex: 1;
}

/* ---------------------------------------------------------------- footer */

.colophon {
  margin-top: clamp(4rem, 10vw, 7rem);
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.colophon-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem 3rem;
  flex-wrap: wrap;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule-soft);
}

.colophon-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  flex-wrap: wrap;
}

.colophon-nav a {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
}

.colophon-nav a:hover {
  color: var(--accent);
}

/*
 * The trading disclosure, on every page.
 *
 * The Companies (Trading Disclosures) Regulations ask for the registered
 * name, number, place of registration and registered office on the company's
 * websites, and the cheapest way to be certain no page is missing them is for
 * the footer to carry them. It also means a reader who lands on the privacy
 * policy from an app store never has to go looking for who wrote it.
 *
 * Set in the label face at small size — this is the imprint line at the foot
 * of a title page, and it should read as one.
 */
.imprint {
  /* The divider above this belongs to `.colophon-top`, which spans the full
     width. Drawing it here instead would cap it at the 58ch measure below and
     leave a short line hanging under the wordmark. */
  padding-top: 1.75rem;
  font-family: var(--font-label);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--ink-faint);
  max-width: 58ch;
}

.imprint p {
  margin: 0 0 0.4rem;
}

.imprint p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------- the "to confirm" mark */

/*
 * An unfilled fact from `_data/company.js`.
 *
 * This site can be deployed before the incorporation paperwork is complete,
 * and the only thing making that safe rather than negligent is that every gap
 * says so. It was a coloured pill, which was both the most app-like object on
 * the site and — being a familiar UI shape — surprisingly easy to stop
 * seeing. Bracketed small caps in a colour nothing else uses cannot be read as
 * finished copy, because finished copy is never in brackets.
 *
 * See the `detail` filter in `eleventy.config.mjs`.
 */
.pending {
  font-family: var(--font-label);
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pending);
  white-space: nowrap;
}

.pending::before {
  content: '[ ';
}

.pending::after {
  content: ' ]';
}
