:root {
  --ink: #101a33;
  --muted: #566079;
  --faint: #8b92a0;
  --blue: #2a6fdb;
  --blue-deep: #1f5cc4;
  --mist: #f1f5fb;
  --error: #b3261e;
  --line: #dfe4ee;
  --paper: #fff;
  --gutter: clamp(16px, 5vw, 80px);
  --link: #1f5cc4;
  --on-blue: #fff;
  --button-hover: #101a33;
  --field-border: #aeb7c9;
  --drawer-shadow: rgb(16 26 51 / 14%);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #eceef2;
  --muted: #a8adb8;
  --faint: #828793;
  --blue: #7fa6e4;
  --blue-deep: #30609f;
  --mist: #202022;
  --error: #ff8f85;
  --line: #323235;
  --paper: #18181a;
  --link: #94b6ea;
  --button-hover: #4577b8;
  --field-border: #505156;
  --drawer-shadow: rgb(0 0 0 / 45%);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  position: relative;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Albert Sans", "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

h1, h2, h3, p, ul { margin: 0; padding: 0; font-weight: 400; }
ul { list-style: none; }
a { color: inherit; text-underline-offset: 4px; }

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

.sprite { position: absolute; }

.top-section {
  position: relative;
  overflow-x: clip;
  touch-action: pan-y;
}

.field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.top {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px var(--gutter);
  font-weight: 500;
}

.top a { text-decoration: none; }
.top a:hover { text-decoration: underline; }

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px clamp(16px, 3vw, 40px);
}

.theme-toggle {
  display: inline-flex;
  margin: -6px;
  padding: 6px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.theme-toggle:hover { color: var(--link); }

.theme-toggle svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* Each mode shows the mode a click switches to. */
.theme-toggle .theme-sun { display: none; }
[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
[data-theme="dark"] .theme-toggle .theme-moon { display: none; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  min-height: calc(100svh - 84px);
  padding: 24px var(--gutter) 72px;
}

h1 {
  font-size: clamp(44px, 6.6vw, 104px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero-sub {
  max-width: 24em;
  margin-top: clamp(20px, 2.4vw, 36px);
  font-size: clamp(20px, 1.9vw, 28px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.no-break { white-space: nowrap; }

.logo {
  display: block;
  justify-self: end;
  width: 100%;
  /* Stops it growing on large screens. This caps its height at about 420px. */
  max-width: 615px;
  height: auto;
  overflow: visible;
}

.logo path {
  fill: var(--paper);
  stroke: var(--blue);
  stroke-width: 6;
  /* Mitred joins spike at the logo's acute corners, where several shapes meet. */
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* Contact page */

.hero-contact {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.nav [aria-current="page"] { color: var(--link); }

.contact-email {
  color: var(--link);
  text-decoration: none;
}

.contact-email:hover { text-decoration: underline; }

.hero-copy .hero-sub + .hero-sub { margin-top: 12px; }

.hero-copy .button { margin-top: clamp(24px, 3vw, 40px); }

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: clamp(20px, 2.6vw, 40px);
  border: 1px solid var(--line);
  background: var(--paper);
}

.field-wide { grid-column: 1 / -1; }

.field-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 500;
}

.required { color: var(--error); }

.field-row input,
.field-row textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--field-border);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.field-row textarea { resize: vertical; }

.field-row [aria-invalid="true"] { border: 2px solid var(--error); }

.error {
  margin-top: 6px;
  color: var(--error);
  font-size: 15px;
  line-height: 1.3;
}

.error:empty,
.form-status:empty { display: none; }

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.form-status {
  max-width: 34em;
  font-size: 16px;
}

.form-status.is-error { color: var(--error); }

/* Moved off screen, not hidden with display: none, so bots still fill it in. */
.form-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Holds the space for the anti-bot check so the form doesn't jump as it loads. */
.turnstile { min-height: 65px; }

.button {
  display: inline-block;
  padding: 14px 24px;
  border: 0;
  border-radius: 8px;
  background: var(--blue-deep);
  color: var(--on-blue);
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { background: var(--button-hover); }

.button:disabled,
.button:disabled:hover {
  background: var(--blue-deep);
  opacity: 0.6;
  cursor: not-allowed;
}

/* Sections */

.block {
  padding: clamp(64px, 9vw, 136px) var(--gutter);
  border-top: 1px solid var(--line);
}

.block-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 20px clamp(32px, 6vw, 96px);
  align-items: end;
  margin-bottom: clamp(48px, 6vw, 88px);
}

.block-head p {
  max-width: 30em;
  color: var(--muted);
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.4;
}

h2 {
  font-size: clamp(38px, 5vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h3 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.icon {
  display: block;
  width: 44px;
  height: 44px;
  fill: none;
  color: var(--blue);
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Main company areas */

.area {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px clamp(32px, 6vw, 96px);
  align-items: start;
}

.area-tint {
  border-top: 0;
  background: var(--mist);
}

.area-tint + .area { border-top: 0; }

.area-head {
  position: sticky;
  top: 40px;
}

.area-head h2 {
  font-size: clamp(36px, 4.4vw, 68px);
  text-wrap: balance;
}

.area-head p {
  max-width: 24em;
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.4;
}

.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 72px) clamp(28px, 4vw, 64px);
}

.services li {
  padding-top: 24px;
  border-top: 1px solid var(--ink);
}

.services li:hover .icon { transform: translateX(8px); }

.services h3 { margin-top: 20px; }

.services p {
  max-width: 32em;
  margin-top: 10px;
  color: var(--muted);
}

/* About */

.about {
  border-top: 0;
  background: var(--mist);
}

.block-head .about-text { color: var(--ink); }

.about .block-head {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: clamp(32px, 4vw, 56px);
}

/* A divider gives the title and intro room before the list below them. */
.about .proof {
  padding-top: clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--line);
}

.proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px clamp(28px, 4vw, 64px);
}

.proof li {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.proof .icon { flex: none; }

.proof p {
  max-width: 20em;
  font-size: clamp(18px, 1.4vw, 20px);
  line-height: 1.35;
}

/* Contact */

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px 48px;
  padding: clamp(64px, 9vw, 136px) var(--gutter);
  background: var(--blue-deep);
  color: var(--on-blue);
}

.contact :focus-visible { outline-color: var(--on-blue); }

.contact-copy p {
  margin-top: 16px;
  font-size: clamp(18px, 1.5vw, 21px);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.contact .button {
  background: var(--on-blue);
  color: var(--blue-deep);
}

.contact .button:hover {
  background: var(--ink);
  color: var(--paper);
}

.email {
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  /* Leaves room below the text for the analytics tab, which can sit at the end of the page. */
  padding: 24px var(--gutter) 64px;
  color: var(--muted);
  font-size: 16px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.foot-links a {
  color: var(--faint);
  text-decoration: none;
}

.foot-links a:hover { text-decoration: underline; }

/* The analytics drawer. Closed, only its tab shows above the bottom of the window. */
.consent {
  --tab-height: 34px;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(820px, calc(100vw - 2 * var(--gutter)));
  margin-inline: auto;
  transform: translateY(calc(100% - var(--tab-height)));
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 -2px 10px var(--drawer-shadow));
}

.consent.is-open { transform: translateY(0); }

.consent.is-scrolling { transform: translateY(100%); }

/* After a choice, the tab sits at the very bottom of the page and opens upward over the footer. */
.consent.is-docked {
  position: absolute;
  transform: none;
  transition: none;
}

.consent.is-docked .consent-panel {
  max-height: 0;
  padding-block: 0;
  overflow: hidden;
  border-width: 0;
  transition: max-height 320ms cubic-bezier(0.2, 0.8, 0.2, 1), padding-block 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.consent.is-docked.is-open .consent-panel {
  max-height: 280px;
  padding-block: 16px;
  border-width: 1px 1px 0;
}

.consent-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--tab-height);
  margin-bottom: -1px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-bottom-color: var(--paper);
  border-radius: 8px 8px 0 0;
  background: var(--paper);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

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

/* A small arrow: up when closed, down when open. */
.consent-tab::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.consent.is-open .consent-tab::after {
  margin-top: -4px;
  transform: rotate(225deg);
}

.consent-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 32px;
  width: 100%;
  padding: 16px 24px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--paper);
  font-size: 15px;
  line-height: 1.4;
}

.consent-panel p {
  flex: 1 1 340px;
  min-width: 0;
}

.consent-panel a { color: var(--link); }

.consent-actions {
  display: flex;
  flex: none;
  gap: 10px;
}

.consent-actions .button {
  padding: 9px 18px;
  font-size: 15px;
}

/* Privacy policy and terms */

.legal-head {
  position: relative;
  padding-block: clamp(24px, 4vw, 56px) clamp(96px, 10vw, 136px);
}

/* Holds the title and panel to 1120px wide and centered. The background keeps going. */
.legal-head,
.legal { padding-inline: max(var(--gutter), calc((100% - 1120px) / 2)); }

.legal-head h1 { font-size: clamp(32px, 3.4vw, 52px); }

.legal-head .hero-sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
}

/* The panel sits over the end of the animated field, as the contact form does. */
.legal {
  position: relative;
  margin-top: -72px;
  padding-block: 0 clamp(64px, 8vw, 112px);
}

.legal-panel {
  border: 1px solid var(--line);
  background: var(--paper);
}

.legal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr);
  gap: 8px clamp(32px, 5vw, 80px);
  padding: clamp(20px, 2.4vw, 32px) clamp(20px, 2.6vw, 40px);
}

.legal-row + .legal-row { border-top: 1px solid var(--line); }

.legal-row h2 {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}

.legal-body {
  max-width: 44em;
  font-size: 16px;
}

.legal-body p + p,
.legal-body ul { margin-top: 10px; }

.legal-body ul {
  padding-left: 1.25em;
  list-style: disc;
}

.legal-body li + li { margin-top: 6px; }

.legal-body strong { font-weight: 500; }

.legal-body a { color: var(--link); }

/* The name and menu stop fitting on one line here. */
@media (max-width: 940px) {
  .top {
    flex-wrap: wrap;
    gap: 8px 24px;
  }
}

@media (max-width: 760px) {
  .top {
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-block: 20px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-bottom: 56px;
  }

  .logo {
    grid-row: 1;
    justify-self: start;
    width: min(78%, 360px);
  }

  .block-head { grid-template-columns: minmax(0, 1fr); }

  .legal-row { grid-template-columns: minmax(0, 1fr); }

  .hero-contact { grid-template-columns: minmax(0, 1fr); }
  .form { grid-template-columns: minmax(0, 1fr); }

  .services,
  .proof { grid-template-columns: minmax(0, 1fr); }

  .services li {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 18px;
  }

  .services .icon { grid-row: 1 / span 2; }
  .services h3 { margin-top: 6px; }
  .services p { grid-column: 2; }
}

@media (max-width: 1040px) {
  .area { grid-template-columns: minmax(0, 1fr); }
  .area-head { position: static; }
  .proof { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .icon,
  .consent,
  .consent.is-docked .consent-panel,
  .consent-tab::after { transition: none; }
}
