/* Design tokens for the Signal design: greyscale plus one blue accent.
 *
 * This is the ONLY file that may contain a color. Everything else uses
 * var(--token). Three places bake these values in as literals because they
 * render outside the page's CSS and cannot read variables; change them
 * together with this file:
 *   - assets/favicon.svg
 *   - internal/charts/charts.go   (Vega-Lite chart theme)
 *   - internal/diagrams/diagrams.go (d2 diagram theme)
 */
:root {
  --ink: #111111;        /* headings, links, dark bands */
  --text: #333333;       /* body copy */
  --muted: #595959;      /* labels, captions; 7:1 on white */
  --rule: #dcdcd8;       /* hairlines */
  --surface: #f6f6f4;    /* cards, figure panels */
  --band: #efefec;       /* header, logo strip, about band */
  --bg: #ffffff;         /* page */
  --ice: #d6d6d2;         /* the iceberg below the waterline */
  --ice-shade: #c4c4bf;   /* its shaded facet */
  --on-dark: #ffffff;
  --on-dark-muted: #d9d9d9;
  --code-bg: #111111;
  --code-text: #f2f2f2;
  --code-muted: #a8a8a4;
  --code-accent: #9bbddf;

  /* The one accent. Used for the waterline, the active nav underline, link
     emphasis and diagram highlights. */
  --accent: #377abe;
  /* Buttons use the accent darkened one step, so white text on it passes
     WCAG AA (4.5:1). */
  --btn-bg: #3577ba;
  --on-accent: #ffffff;

  /* The mark: a light tip above two heavier blocks. */
  --logo-light: #9bbddf;
  --logo-mid: #377abe;
  --logo-dark: #214972;

  --font-sans: "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}
/* Fonts, resets and base typography. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 30px;
}

/* Atkinson Hyperlegible has two weights, 400 and 700. Headings use 700. */
h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

h1 {
  font-size: 46px;
  line-height: 54px;
  letter-spacing: -0.025em;
}

p {
  margin: 0;
}

img,
svg {
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 3px;
}

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

/* The small uppercase mono label that introduces a section. */
.lbl {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 720px) {
  h1 {
    font-size: 35px;
    line-height: 43px;
  }
}
/* Page containers and the bands shared by every page. */

/* Reading column. */
.col {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Wide container for grids, figures and the header. */
.wide {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Dark call-to-action band that closes a page. */
.cta-band {
  background: var(--ink);
}

.cta-band .col {
  padding-top: 72px;
  padding-bottom: 72px;
}

.cta-band h2 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 42px;
  letter-spacing: -0.02em;
  color: var(--on-dark);
}

.cta-band p {
  margin: 0 0 28px;
  color: var(--on-dark-muted);
}

/* The 404 page. */
.notfound {
  padding-top: 96px;
  padding-bottom: 120px;
}

.notfound p {
  margin-top: 20px;
}

@media (max-width: 720px) {
  .cta-band h2 {
    font-size: 28px;
    line-height: 36px;
  }
}
/* The one button style. It is the only solid use of the accent. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 4px;
  background: var(--btn-bg);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 700;
  line-height: 24px;
  text-decoration: none;
}

.btn:hover {
  background: var(--ink);
  color: var(--on-dark);
}

.btn svg {
  flex: none;
}

/* Header size. 44px rather than the artboard's 42px, to meet the minimum
   touch target. */
.btn-sm {
  min-height: 44px;
  padding: 0 18px;
  font-size: 15px;
}

/* On the dark band a blue button needs an edge to separate it from the ink,
   and its hover inverts instead of turning ink-on-ink. The edge is a shadow,
   not an outline: outline is reserved for the keyboard focus ring. */
.cta-band .btn {
  box-shadow: 0 0 0 1px var(--on-dark);
}

.cta-band .btn:hover {
  background: var(--on-dark);
  color: var(--ink);
}

/* The default focus ring is the accent, which is too dim on ink. */
.cta-band .btn:focus-visible {
  outline: 3px solid var(--on-dark);
  outline-offset: 4px;
}
/* Site header: mark and wordmark on the left, nav and booking button right. */

.site-header {
  background: var(--band);
  border-bottom: 1px solid var(--rule);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.brand svg {
  flex: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  font-size: 16px;
  line-height: 24px;
}

.nav-link {
  text-decoration: none;
}

.nav-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}

/* The section the current page belongs to. */
.nav-link.is-active {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}

/* On phones the header is the mark and the booking button; the sections are
   one scroll away on a single-page site. */
@media (max-width: 720px) {
  .nav-link {
    display: none;
  }
}
.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 36px;
  font-size: 15px;
  line-height: 24px;
  color: var(--muted);
}

.site-footer-links {
  display: flex;
  gap: 20px;
}
/* Figures inside an article: images, the grey panel that holds diagrams and
   inline SVGs, pull quotes, and the footnote list. */

.fig {
  margin: 0 0 28px;
}

.fig-img img {
  display: block;
  width: 100%;
  border-radius: 4px;
}

.fig-img figcaption {
  margin-top: 8px;
  font-size: 15px;
  line-height: 22px;
  color: var(--muted);
}

/* Floated images wrap text on wide screens and go full width on phones. */
@media (min-width: 621px) {
  .fig-img.align-left {
    float: left;
    width: 44%;
    margin: 6px 28px 16px 0;
  }

  .fig-img.align-right {
    float: right;
    width: 44%;
    margin: 6px 0 16px 28px;
  }
}

/* Diagrams, charts and hand-drawn SVGs sit in a quiet grey panel. */
.fig-panel {
  padding: 24px;
  background: var(--surface);
  border-radius: 4px;
  overflow-x: auto;
}

.fig-panel svg {
  display: block;
  width: 100%;
  height: auto;
}

/* d2 and Vega output carries its own pixel size (wrapDiagram makes sure of
   it). Show it at that size, centered, and let it shrink on narrow screens;
   never stretch it. */
.fig-diagram svg {
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}

.pullquote {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
  margin: 48px 0;
  padding: 32px 0;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.pullquote-photo {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border-radius: 4px;
  object-fit: cover;
}

.pullquote blockquote {
  flex: 1 1 360px;
  margin: 0;
}

.pullquote blockquote p {
  margin: 0;
  font-size: 25px;
  line-height: 36px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.pullquote footer {
  margin-top: 12px;
  font-size: 16px;
  line-height: 24px;
  color: var(--muted);
}

/* Footnotes: a plain numbered list at the end of the article. */
.footnotes {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
  line-height: 26px;
}

.footnotes hr {
  display: none;
}

.footnotes ol {
  margin: 0;
  padding-left: 22px;
}

.footnotes p {
  margin: 0 0 8px;
}

.footnote-ref {
  font-size: 13px;
  line-height: 0;
  text-decoration: none;
  padding: 0 2px;
}

.footnote-backref {
  text-decoration: none;
}

@media (max-width: 720px) {
  .fig-panel {
    padding: 16px;
  }

  /* A wide hand-drawn SVG shrunk to a phone's width has unreadable labels.
     Keep it at a legible size and let the panel scroll sideways instead.
     Not for d2 and Vega output, which is often narrow and would be blown up. */
  .fig-panel:not(.fig-diagram) > svg {
    min-width: 560px;
  }

  .pullquote blockquote p {
    font-size: 21px;
    line-height: 31px;
  }
}

/* Text inside an inline SVG inherits the page's sans font. This opts a label
   into the mono face instead. */
.svg-mono {
  font-family: var(--font-mono);
  font-weight: 500;
}
/* Code. Blocks are dark, as in the design; Chroma emits class names and the
   colors come from tokens, so there is no inline styling. */

pre,
pre.chroma {
  margin: 0 0 28px;
  padding: 20px 24px;
  background: var(--code-bg);
  border-radius: 4px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 24px;
  color: var(--code-text);
}

pre code {
  font: inherit;
  color: inherit;
  background: none;
  padding: 0;
}

/* Inline code. */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  color: var(--ink);
}

/* Greyscale plus the light accent: keywords carry the accent, comments
   recede, everything else stays the block's text color. */
.chroma .k,
.chroma .kd,
.chroma .kn,
.chroma .kp,
.chroma .kr,
.chroma .kc,
.chroma .kt {
  color: var(--code-accent);
}

.chroma .c,
.chroma .c1,
.chroma .cm,
.chroma .ch,
.chroma .cs,
.chroma .cp {
  color: var(--code-muted);
  font-style: italic;
}

.chroma .s,
.chroma .s1,
.chroma .s2,
.chroma .sb,
.chroma .sd,
.chroma .m,
.chroma .mi,
.chroma .mf {
  color: var(--on-dark);
}
/* The case study page, and .prose: the typography of a rendered Markdown
   body, which blog posts will reuse. */

.case-head {
  padding-top: 64px;
  padding-bottom: 32px;
}

.case-summary {
  margin-top: 20px;
  font-size: 21px;
  line-height: 33px;
}

/* The headline numbers. A <dl> in a grid: each cell is a label over a value,
   separated by hairlines that also work when the grid wraps. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  margin: 0 0 48px;
  background: var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

.stat {
  padding: 28px;
  background: var(--surface);
}

.stat .lbl {
  margin-bottom: 8px;
}

.stat dd {
  margin: 0;
  font-size: 44px;
  line-height: 50px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* The hero keeps the image's own proportions; a fixed crop would cut the
   sides off a wide screenshot. */
.case-hero {
  margin-top: 0;
  margin-bottom: 48px;
}

.case-hero img {
  display: block;
  width: 100%;
  border-radius: 4px;
}

.prose {
  padding-bottom: 56px;
  line-height: 31px;
}

.prose > p,
.prose > ul,
.prose > ol,
.prose > table {
  margin: 0 0 20px;
}

.prose h2 {
  margin: 48px 0 12px;
  font-size: 28px;
  line-height: 36px;
  letter-spacing: -0.015em;
}

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

.prose h3 {
  margin: 32px 0 8px;
  font-size: 21px;
  line-height: 28px;
}

.prose li {
  margin-bottom: 6px;
}

.prose > blockquote {
  margin: 0 0 20px;
  padding-left: 20px;
  border-left: 3px solid var(--ink);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 24px;
}

.prose th,
.prose td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.prose th {
  color: var(--ink);
}

/* Emphasis in running text: the accent underline. */
.prose a {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

/* Clear floated images at each new section. */
.prose h2,
.prose .fig-panel,
.prose .pullquote,
.prose .footnotes {
  clear: both;
}

@media (max-width: 720px) {
  .case-head {
    padding-top: 40px;
  }

  .case-summary {
    font-size: 19px;
    line-height: 30px;
  }

  .stat {
    padding: 20px;
  }

  .stat dd {
    font-size: 36px;
    line-height: 42px;
  }
}
/* The landing page, section by section, top to bottom. */

/* ---- Hero ---- */

.hero {
  padding-top: 80px;
  padding-bottom: 32px;
}

.hero-lede {
  margin-top: 24px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 36px;
}

.hero-note {
  font-size: 15px;
  line-height: 22px;
  color: var(--muted);
}

/* ---- Iceberg ---- */

.iceberg {
  margin-top: 32px;
  margin-bottom: 0;
  padding-bottom: 64px;
}

.iceberg svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Two drawings of the same iceberg; one is shown. See home.html.tmpl. The
   selector repeats ".iceberg svg" so it outranks the display rule above. */
.iceberg svg.iceberg-narrow {
  display: none;
}

/* ---- Client logos ---- */

.logos {
  background: var(--band);
}

.logos .wide {
  padding-top: 40px;
  padding-bottom: 40px;
}

/* Four across, so eight logos make two even rows; auto-fit would leave one
   logo alone on a second row. Two across on phones (see the end of the file). */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 84px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--rule);
}

/* Every logo is shown in grey so no client's brand color competes with the
   page's single accent. */
.logo-tile img {
  /* Wide wordmarks are limited by the tile's width, square marks by its
     height; 68px keeps the small type in square logos readable. */
  max-width: 100%;
  max-height: 68px;
  object-fit: contain;
  filter: grayscale(1);
}

/* ---- Featured case study ---- */

.work {
  padding-top: 72px;
  padding-bottom: 24px;
}

.feature {
  display: flex;
  flex-wrap: wrap;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
}

.feature-image {
  flex: 1 1 360px;
  width: 360px;
  min-height: 340px;
  object-fit: cover;
}

.feature-body {
  flex: 1 1 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 36px;
}

.feature-kicker {
  font-size: 15px;
  line-height: 24px;
  color: var(--muted);
}

.feature-title {
  font-size: 30px;
  line-height: 38px;
  letter-spacing: -0.02em;
}

.feature-summary {
  font-size: 17px;
  line-height: 28px;
}

.feature-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

.feature-stats li {
  padding-top: 8px;
  border-top: 3px solid var(--ink);
}

.feature-stats strong {
  display: block;
  font-size: 26px;
  line-height: 32px;
  color: var(--ink);
}

.feature-link {
  margin-top: 8px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.feature:hover .feature-link {
  text-decoration-color: var(--ink);
}

.upcoming {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0 32px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.upcoming li {
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}

.upcoming span {
  display: block;
}

.upcoming-meta {
  font-size: 15px;
  line-height: 24px;
  color: var(--muted);
}

.upcoming-title {
  margin: 4px 0;
  font-weight: 700;
  line-height: 27px;
  color: var(--ink);
}

/* ---- Services ---- */

.services {
  padding-top: 80px;
  padding-bottom: 80px;
}

.section-heading {
  margin-bottom: 12px;
  font-size: 34px;
  line-height: 42px;
  letter-spacing: -0.02em;
}

.section-intro {
  max-width: 640px;
  margin-bottom: 36px;
}

.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  border: 2px solid var(--surface);
  border-radius: 4px;
  background: var(--surface);
  font-size: 17px;
  line-height: 28px;
}

/* The offer most clients start with gets the heavy outline. */
.service-card.is-featured {
  border-color: var(--ink);
  background: var(--bg);
}

.service-card .lbl {
  margin: 0;
}

.service-card h3 {
  font-size: 26px;
  line-height: 32px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: auto 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.facts dt {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

.facts dd {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  color: var(--ink);
}

.build {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 2px solid var(--ink);
}

.build-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px 48px;
  font-size: 17px;
  line-height: 28px;
}

.build-options h3 {
  margin-bottom: 6px;
  font-size: 21px;
  line-height: 28px;
}

.build-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 32px;
  padding: 24px;
  background: var(--band);
  border-radius: 4px;
}

.build-bar p {
  flex: 1 1 320px;
  font-size: 17px;
  line-height: 27px;
}

/* ---- About ---- */

.about {
  background: var(--band);
}

.about .col {
  padding-top: 64px;
  padding-bottom: 64px;
}

.about-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 32px;
}

.about-portrait {
  flex: 0 0 160px;
  width: 160px;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
}

.about-text {
  flex: 1 1 320px;
  min-width: 0;
}

.about-lead {
  margin-bottom: 16px;
  font-size: 21px;
  line-height: 32px;
  font-weight: 700;
  color: var(--ink);
}

/* ---- Phones ---- */

@media (max-width: 720px) {
  .hero {
    padding-top: 48px;
  }

  .iceberg {
    padding-bottom: 40px;
  }

  .logo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .iceberg svg.iceberg-wide {
    display: none;
  }

  .iceberg svg.iceberg-narrow {
    display: block;
  }

  .work {
    padding-top: 48px;
  }

  .feature-image {
    min-height: 240px;
  }

  .feature-body,
  .service-card {
    padding: 24px;
  }

  .feature-title {
    font-size: 26px;
    line-height: 33px;
  }

  .services {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .section-heading {
    font-size: 28px;
    line-height: 36px;
  }

  .service-cards,
  .upcoming,
  .build-options {
    grid-template-columns: 1fr;
  }
}
